activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiri Daněk (JIRA) <>
Subject [jira] [Commented] (ARTEMIS-1783) Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/google/common/base/Supplier
Date Wed, 04 Apr 2018 15:00:05 GMT


Jiri Daněk commented on ARTEMIS-1783:

The error was my doing, because I also had, which depended on guava, and what happened was
that for some reason I did not get guava in my uberjar.

I still think that artemis-core-client should have guava in its pom, because it is directly
using it. It should not be "accidentally" present there due to transitive dependencies. But
that is trivial code-style issue.

> Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError:
> --------------------------------------------------------------------------------------------------------------------------
>                 Key: ARTEMIS-1783
>                 URL:
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.5.0
>            Reporter: Jiri Daněk
>            Priority: Trivial
> When using my program cli-artemis-jms at, which
depends on activemq-artemis-jms-client, I get the following stack trace
> {noformat}
> junit5(?) $ java -jar systemtests/client_executable/cli-artemis-jms.jar receiver --address
test --log-msgs json --count 0
> Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError:
>         at org.apache.activemq.artemis.core.message.impl.CoreMessageObjectPools.<init>(
>         at org.apache.activemq.artemis.core.protocol.ClientPacketDecoder.<init>(
>         at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.createPacketDecoder(
>         at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.connect(
>         at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.establishNewConnection(
>         at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.getConnection(
>         at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.getConnectionWithRetry(
>         at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.connect(
>         at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(
>         at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(
>         at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(
>         at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(
>         at com.redhat.mqe.acc.AccConnectionManager.<init>(
>         at com.redhat.mqe.acc.AccConnectionManagerFactory.make(
>         at com.redhat.mqe.acc.AccConnectionManagerFactory.make(
>         at com.redhat.mqe.lib.CoreClient.createConnection(
>         at com.redhat.mqe.lib.ReceiverClient.consumeMessage(
>         at com.redhat.mqe.lib.ReceiverClient.startClient(
>         at com.redhat.mqe.lib.Main.main(
>         at com.redhat.mqe.acc.Main.main(
> Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Supplier
>         ... 20 more
> Caused by: java.lang.ClassNotFoundException:
>         at
>         at java.lang.ClassLoader.loadClass(
>         at sun.misc.Launcher$AppClassLoader.loadClass(
>         at java.lang.ClassLoader.loadClass(
>         ... 20 more
> {noformat}
> I get this with artemis-jms-client 2.5.0, but not with artemis-jms-client 2.4.0.
> I believe the guilty commit is in ARTEMIS-1586, "794e56da99456e Refactor to make more
generic", which introduced usage of Google Guava, without adding it to the package's pom file,
causing my maven to miss that transitive dependency when building uberjar.
> The command above runs when triggered from Intellij IDE, where the dependency is on classpath,
for some reason.
> Workaround is easy, add Guava to dependencies of your own program which is using the
artemis jms library.

This message was sent by Atlassian JIRA

View raw message