Search code examples
javajmshornetq

Getting Error when starting HornetQ server


I'm learning Spring from the book "Pro Spring 5". In the current chapter we have to use HornetQ as the message broker. I downloaded HornetQ files and in C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\bin I open a command prompt and execute run.bat. My PC is running on Windows 10. I'm also using Java 13.

I'm getting this ouptut :

C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\bin>run.bat
A subdirectory or file ..\logs already exists.
***********************************************************************************
"java  -XX:+UseParallelGC  -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M-Dhornetq.config.dir=..\config\stand-alone\non-clustered- 
-Djava.util.logging.manager=org.jboss.logmanager.LogManager Djava.util.logging.config.file=..\config\stand-alone\non-clustered\logging.properties 
-Djava.library.path=. -classpath ..\config\stand-alone\non-clustered;..\schemas\;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-aerogear-integration.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-amqp-protocol.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-bootstrap.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-commons.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-core-client.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-jboss-as-integration.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-jms-client.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-jms-server.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-journal.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-native.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-ra.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-rest.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-server.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-service-sar.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-spring-integration.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-stomp-protocol.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-tools.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\hornetq-twitter-integration.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\jboss-jms-api.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\jboss-mc.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\jnp-client.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\jnpserver.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\netty.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\proton-api.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\proton-j-impl.jar;
C:\Users\User\Downloads\hornetq-2.4.0.Final-bin\hornetq-2.4.0.Final\lib\proton-jms.jar org.hornetq.integration.bootstrap.HornetQBootstrapServer hornetq-beans.xml"
***********************************************************************************
Unrecognized VM option 'AggressiveOpts'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I would be really grateful if you could help me with this problem.


Solution

  • HornetQ 2.4.0.Final is not compatible with Java 13. You need to use Java 8.

    The copyright for Pro Spring 5 is 2017 which probably means most of the book was written in 2016. Java 9 wasn't released until September 2017 and HornetQ 2.4.0.Final was released in December 2013. My point here is that if you're going to use an old book and old software you need to use a comparably old version of Java.

    It's also worth noting that the HornetQ code-base was donated to the Apache ActiveMQ community in 2014 and the broker has carried on as ActiveMQ Artemis. There hasn't been a release of HornetQ in the last 7 years or so because of this. However, there are regular releases of ActiveMQ Artemis (2.13.0 was released just a few weeks ago).