You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rob Godfrey (JIRA)" <ji...@apache.org> on 2017/06/15 16:00:01 UTC

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

     [ https://issues.apache.org/jira/browse/QPID-7824?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Godfrey updated QPID-7824:
------------------------------
    Priority: Major  (was: Blocker)

> 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
>             Fix For: qpid-java-6.1.1, qpid-java-6.1.2, qpid-java-6.1.3
>
>
> 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: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org