java - JMS: activemq-version.properties is not available -


i trying establish jms connection. in connectionfactory.createcontext, error activemq version loader reports properties file missing:

caused by: java.lang.runtimeexception: activemq-version.properties not available @ org.apache.activemq.artemis.utils.versionloader.getversion(versionloader.java:87)

i running project eclipse - it's eclipse classpath issue, can't find library missing.

full stacktrace:

javax.jms.jmsruntimeexception: failed create session factory     @ org.apache.activemq.artemis.jms.client.jmsexceptionutils.converttoruntimeexception(jmsexceptionutils.java:88)     @ org.apache.activemq.artemis.jms.client.activemqconnectionfactory.createcontext(activemqconnectionfactory.java:262)     @ org.apache.activemq.artemis.jms.client.activemqconnectionfactory.createcontex    t(activemqconnectionfactory.java:248)     @ at.cone.health.dispo.online.disposerverfacadeimpl$jmsreceiverthread.run(disposerverfacadeimpl.java:109) caused by: javax.jms.jmsexception: failed create session factory     @ org.apache.activemq.artemis.jms.client.activemqconnectionfactory.createconnectioninternal(activemqconnectionfactory.java:727)     @ org.apache.activemq.artemis.jms.client.activemqconnectionfactory.createcontext(activemqconnectionfactory.java:255)     ... 2 more caused by: java.lang.runtimeexception: activemq-version.properties not available     @ org.apache.activemq.artemis.utils.versionloader.getversion(versionloader.java:87)     @ org.apache.activemq.artemis.core.protocol.core.impl.activemqclientprotocolmanager.<init>(activemqclientprotocolmanager.java:81)     @ org.apache.activemq.artemis.core.protocol.core.impl.activemqclientprotocolmanagerfactory.newprotocolmanager(activemqclientprotocolmanagerfactory.java:49)     @ org.apache.activemq.artemis.core.client.impl.serverlocatorimpl.newprotocolmanager(serverlocatorimpl.java:575)     @ org.apache.activemq.artemis.core.client.impl.clientsessionfactoryimpl.<init>(clientsessionfactoryimpl.java:173)     @ org.apache.activemq.artemis.core.client.impl.serverlocatorimpl.createsessionfactory(serverlocatorimpl.java:757)     @ org.apache.activemq.artemis.jms.client.activemqconnectionfactory.createconnectioninternal(activemqconnectionfactory.java:724) ... 3 more 

the code try set connection: initialcontext namingcontext = new initialcontext(env);

                connectionfactory connectionfactory = (connectionfactory) namingcontext.lookup(connection_factory);                 system.out.println("got connectionfactory " + connection_factory);                  destination = (destination) namingcontext.lookup(destination);                  system.out.println("got jms endpoint " + destination);                  final jmscontext context = connectionfactory.createcontext("internal", "internal");                  this.context = context;                  jmsconsumer consumer = context.createconsumer(destination, "client='" + clientuid + "'", true);                  // receive same number of messages sent 

the project ant based, cannot use maven dependency management. nevertheless, server part uses maven build, have local maven repository , eclipse build path variable m2_repo pointing .m2 directory. tried set library dependency in eclipse project. running project eclipse, can - @ first - ignore ant related dependencies, , focus on eclipse (but without maven).

i added library dependency wildfly-client-all-10.0.0.final.jar maven repo (using m2_repo variable, extended path). library correctly displayed referenced library in eclipse project.

i implemented demo same lines of codes in eclipse maven project. here didn't exception, in demo able receive messages. assume it's classpath issue.

i searched missing activemq-version.properties on google , on stackoverflow, didn't find related. didn't find resource called activemq-version.properties, not in demo project (and dependencied) executed successfully.

after more investigation, did identify reason.

in run config, had different classpath. classpath remained elder configuration. here, didn't use same jar maven build. run configuration contained both jboss-client.jar , jboss-cli-client.jar wildfly/bin/client directory.

this configuration wrong, , caused additional warning didn't recognize in logs, hint solution:

warn: ejb client integration not available due problem setting ejb client handler

i changed wildfly-client-all-10.0.0.final.jar contained in maven project runtimes, again didn't solve issue.

then found article: https://developer.jboss.org/thread/267824

solution: first configuration approach runtime config, using jar wildfly\bin\client directory, jboss-cli-client.jar , not jboss-client-jar.


Comments