[jira] [Comment Edited] (QPID-7824) ClassCastException on Broker class line 147

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Comment Edited] (QPID-7824) ClassCastException on Broker class line 147

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/QPID-7824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051105#comment-16051105 ]

Gabriel Volpe edited comment on QPID-7824 at 6/19/17 10:04 AM:

Okay, it's finally working, thanks for your help!

Here's the Embedded Broker I have created for testing purposes: [https://github.com/gvolpe/fs2-rabbit/blob/master/core/src/test/scala/com/github/gvolpe/fs2rabbit/embedded/EmbeddedAmqpBroker.scala]

EDIT: Updated URL.


was (Author: gvolpe):
Okay, it's finally working, thanks for your help!

Here's the Embedded Broker I have created for testing purposes: [https://github.com/gvolpe/fs2-rabbit/blob/master/src/test/scala/com/github/gvolpe/fs2rabbit/embedded/EmbeddedAmqpBroker.scala]


> ClassCastException on Broker class line 147
> -------------------------------------------
>                 Key: QPID-7824
>                 URL: https://issues.apache.org/jira/browse/QPID-7824
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: qpid-java-6.1.1, qpid-java-6.1.2, qpid-java-6.1.3
>         Environment: - Java 8
> - Scala 2.11.8
>            Reporter: Gabriel Volpe
> Explicit class casting makes integration with other libraries impossible. I've been trying to get a workaround but it seems I cannot do anything. The problem is in the Qpid library. Specifically Broker class line #147. Here's the full stack trace:
> {code:java}
> [info] Exception encountered when attempting to run a suite with class name: com.github.gvolpe.fs2rabbit.Fs2RabbitSpec *** ABORTED ***
> [info]   java.lang.ClassCastException: org.slf4j.helpers.SubstituteLogger cannot be cast to ch.qos.logback.classic.Logger
> [info]   at org.apache.qpid.server.Broker$1.run(Broker.java:147)
> [info]   at java.security.AccessController.doPrivileged(Native Method)
> [info]   at javax.security.auth.Subject.doAs(Subject.java:422)
> [info]   at org.apache.qpid.server.Broker.startup(Broker.java:142)
> [info]   at com.github.gvolpe.fs2rabbit.embedded.EmbeddedAmqpBroker$.start(EmbeddedAmqpBroker.scala:16)
> [info]   at com.github.gvolpe.fs2rabbit.Fs2RabbitSpec.beforeAll(Fs2RabbitSpec.scala:19)
> [info]   at org.scalatest.BeforeAndAfterAll$class.beforeAll(BeforeAndAfterAll.scala:187)
> [info]   at com.github.gvolpe.fs2rabbit.Fs2RabbitSpec.beforeAll(Fs2RabbitSpec.scala:14)
> [info]   at org.scalatest.BeforeAndAfterAll$class.run(BeforeAndAfterAll.scala:253)
> [info]   at com.github.gvolpe.fs2rabbit.Fs2RabbitSpec.run(Fs2RabbitSpec.scala:14)
> {code}
> The simple solution would be to avoid the unnecessary casting. Now this is happening on line 147:
> {code:java}
> ch.qos.logback.classic.Logger logger =
>                         (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
> {code}
> Simple fix:
> {code:java}
> org.slf4j.Logger logger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]