I'm trying to run hornetq inside openejb/geronimo for unit testing the mdbs normally deployed in JBoss, but I'm running into a little trouble. I'm sure I'm just missing some configuration file or something. Openejb supports JCA, so I have dropped the hornetq-ra.rar file into my classpath, and it is being automatically discovered by openejb. Unfortunately it throws this exception. I've tried adding all the other hornetq jars to the classpath, and also setting
to point to the stand-alone/non-clustered configuration dir in the 2.0.0.BETA5 distribution. But I always get the below exception (I've included some possibly relevant log messages as well)
INFO - Configuring Service(id=hornetq-raRA, type=Resource, provider-id=hornetq-raRA)
INFO - Configuring Service(id=hornetq-ra, type=Resource, provider-id=hornetq-ra)
INFO - Configuring Service(id=hornetq-ra, type=Container, provider-id=Default MDB Container)
Aug 26, 2009 6:34:51 PM org.hornetq.core.logging.Logger info
INFO: HornetQ resource adaptor started
Aug 26, 2009 6:34:53 PM org.hornetq.core.logging.Logger error
SEVERE: Unabler to start activation
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Forgot the last sentence of my post: What am I doing wrong?
We never tested it with openejb.
The new InitialContext() is looking for a jndi.properties.
Maybe this would need some code changes to run there.
We would love to have you as a contributor if you make it run on openejb.
ok Thanks. I guess I'll poke around the source then...
The JCA adapter should work with Geronimo, if Geronimo is JEE compliant.
Firstly - where did you start your HornetQ server? Did you configure the JCA adapter to point at your started HornetQ server?
Andy Taylor should be able to help you in configuring it properly. Also the user manual goes into a lot of detail on how to do this.
Actually adding the jndi.properties file that Clebert mentioned to my classpath resolved my error. It seems like to integrate with openejb you just need the hornetq-ra.rar and the jndi.properties file in the classpath. Openejb discovers any JCA resource adapters in the classpath and tries to start them up automatically. Now based on the logging I am seeing openejb is starting HornetQ and adding my MDBs to a container called hornet-ra.
I haven't actually got an actual unit test together to trigger the mdb, so I will update this thread again at that point, but so far so good.
Thanks for all the help!