0

Is it possible to get (or build) an equivalent of artemis-jms-client-all-2.x.0.jar compatible with Java 1.7?

I need it because Weblogic SOA 10.x doesn't support Java 1.8, and I would like to connect it to ActiveMQ Artemis.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43

1 Answers1

1

The ActiveMQ Artemis JMS client (and many of its dependencies) use language features from Java 1.8 so there is no 2.x release which is compatible with Java 1.7. It is theoretically possible to use a 1.4 or earlier release with a current 2.x broker, but that was before the "artemis-jms-client-all" jar was available so you'd need to use the "artemis-jms-client" jar and include all the client dependencies manually.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • Thanks for your answer Justin. I'll try that and see if it's worth it. Thanks also for simplifying the question (not used to it). – Eric NOYELLE Jul 01 '19 at 13:46
  • Hi Justin, I think I was able to build a jar compatible java 1.7 with all dependencies. But I don't know what connection Factory name to provide. I have tried the connection factory `XAConnectionFactory` and it tells me `javax.naming.NameNotFoundException: XAConnectionFactory`... That used to work with `artemis-jms-client-all-2.7.0.jar`. Do you have any suggestion? Thanks, Eric. – Eric NOYELLE Jul 01 '19 at 15:50
  • What version of the client did you build? What properties are you providing to your `InitialContext` for the JNDI lookup? – Justin Bertram Jul 01 '19 at 16:58
  • For the jar, I took `artemis-jms-client-1.4.0.jar`, and added the missing parts (**javax** picked from `artemis-jms-client-all-2.7.0.jar` and **org.apache.activemq.artemis.api.core** from `artemis-commons-1.4.0.jar`). Here is my JNDI Initial Context: `Context.INITIAL_CONTEXT_FACTORY=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory`, `Context.PROVIDER_URL=tcp://service01.dev.fld:61616`, `queue.testReqQueue=testReqQueue`. – Eric NOYELLE Jul 02 '19 at 07:45
  • You can't find `XAConnectionFactory` because it's not defined by default in the 1.4.0 client. This convenience was added via https://issues.apache.org/jira/browse/ARTEMIS-1164. You'll need to define it yourself using something like `connectionFactory.XAConnectionFactory=tcp://service01.dev.fld:61616?type=XA_CF`. – Justin Bertram Jul 02 '19 at 14:36
  • Hi Justin, I was able to create a "artemis-jms-client-all-1.4.0.jar" which seems to work well when I use it with my standalone Java client (under Linux and Windows). But when I use it with weblogic 10, it throws the exception: `java.lang.NoClassDefFoundError: Could not initialize class org.apache.activemq.artemis.utils.uri.BeanSupport`. Would that be a classloader issue? – Eric NOYELLE Jul 03 '19 at 13:48
  • Based on the fact that everything works outside of WebLogic I would say that you're hitting a classloader issue of some kind. However, I'm not familiar with WebLogic classloading semantics so I can't say how to deal with it. – Justin Bertram Jul 03 '19 at 16:13
  • Yes, thank you very much Justin: With your guidance, I was able to recreate a functional "artemis-jms-client-all-1.4.0.jar". I just put it in the first position of Weblogic's classpath, and it works! – Eric NOYELLE Jul 04 '19 at 08:49