Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup HornetQ Demo

Tags:

hornetq

I'm trying to recreate the HornetQ examples with my own test projects. However I'm having class loader issues. Obviously I'm missing some dependencies that are not specified in the docs.

The docs had me add

  • hornetq-core-client.jar
  • netty.jar
  • hornetq-jms-client.jar
  • jboss-jms-api.jar

I'm getting this error:

javax.naming.NoInitialContextException: Cannot instantiate class:
   org.jnp.interfaces.NamingContextFactory 
[Root exception is java.lang.ClassNotFoundException:
   org.jnp.interfaces.NamingContextFactory]

Where can I find this class (and any others that might be needed)?

like image 695
rynmrtn Avatar asked Feb 09 '13 16:02

rynmrtn


2 Answers

I recently hit the same issue. Recreating the topic example, i had to add the following:

jnp-client.jar hornetq-commons.jar

Both should be in the hornetq lib

like image 166
edclrk Avatar answered Oct 12 '22 08:10

edclrk


For what is worth, starting with HornetQ 2.3 everything has been Mavenized. So if you ever have trouble figuring out a dependency list for a HornetQ example, just change into the example's folder and ask Maven:

cd hornetq/examples/jms/topic
mvn dependency:list
like image 24
Francisco Avatar answered Oct 12 '22 09:10

Francisco