Home > Back-end >  I get "Cannot access org.apache.activemq.ActiveMQConnectionFactory" error, When I upgraded
I get "Cannot access org.apache.activemq.ActiveMQConnectionFactory" error, When I upgraded

Time:12-02

I upgraded activemq-all version from 5.16.3 to 5.17.2. When I run the application, I get this error:

java: cannot access org.apache.activemq.ActiveMQConnectionFactory
  bad class file: /E:/<username>/.m2/repository/org/apache/activemq/activemq-all/5.17.2/activemq-all-5.17.2.jar!/org/apache/activemq/ActiveMQConnectionFactory.class
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

And when I run maven build also:

cannot access org.apache.activemq.ActiveMQConnectionFactory

Please help. Thank you.

CodePudding user response:

You need Java 11 to use ActiveMQ "Classic" 5.17.x. Note that the download page on the ActiveMQ website says this about 5.17.2:

Java compatibility: 11 

You apparently are using Java 8 still which is why you're getting this error:

class file has wrong version 55.0, should be 52.0

If you can't upgrade your version of Java you should continue using 5.16.x.

  • Related