[jira] [Created] (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
|  
Report Content as Inappropriate

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

JIRA jira@apache.org
Gabriel Volpe created QPID-7824:
-----------------------------------

             Summary: 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 Client
    Affects Versions: qpid-java-6.1.3, qpid-java-6.1.2, qpid-java-6.1.1
         Environment: - Java 8
- Scala 2.11.8

            Reporter: Gabriel Volpe
            Priority: Blocker
             Fix For: qpid-java-6.1.3, qpid-java-6.1.2, qpid-java-6.1.1


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
(v6.4.14#64029)

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

Loading...