[Users] unable to connect ActiveMQ with JMS-bc in Quickstart 3.0

m_liu petals-components at ebmwebsourcing.com
Wed Mar 16 10:27:42 CET 2011


I wonder if there is an example showing how to connect ActiveMQ with JMS-bc in Petals 3.0 and also 2.x.

For ActiveMQ to work with a Java application, jndi.properties must be in the classpath of the application. In my case, it should be in the classpath of the JMS-bc. I re-packaged JMS-bc.zip to include the jndi.properties along with all the other required ActiveMQ client jars. I then updated its jbi.xml to include those new jars.

I then put the following in the SU of the JMS-bc to define the JNDI properties specific to ActiveMQ:

<petalsCDK:params>
	<petalsCDK:param name="address">tcp://localhost:61616</petalsCDK:param>
	<petalsCDK:param name="destination-name">MyQueue</petalsCDK:param>
	<petalsCDK:param name="initial-context-factory">
org.apache.activemq.jndi.ActiveMQInitialContextFactory</petalsCDK:param>
	<petalsCDK:param name="connection-factory">queueConnectionFactory</petalsCDK:param>
	<petalsCDK:param name="user"></petalsCDK:param>
	<petalsCDK:param name="password"></petalsCDK:param>
	<petalsCDK:param name="transacted">false</petalsCDK:param>
	<petalsCDK:param name="operation">printMessage</petalsCDK:param>
</petalsCDK:params>

Notice the destination-name of 'MyQueue' is defined as a property referencing a physical ActiveMQ queue name in the jndi.properties file which is packaged inside JMS-bc.zip. 

My problem is when I deploy my SA, I always get a NamingNotFoundException thrown by JMS-bc of "TechnicalException: Destination 'MyQueue' not found in the JNDI context". 

This appears to me as if the jndi.properties file which is packaged in the top level of the JMS-bc.zip is never picked up as a resource to do its initialization. I tried to put this jndi.properties in a number of different places in the JMS-bc.zip, even inside one of the required ActiveMQ client jar, but none worked. However all the ActiveMQ client jars were loaded successfully by the JMS-bc because otherwise I would have gotten ClassNotFoundExceptions for ActiveMQInitialContextFactory.

Has anyone been able to link a JMS provider other than JORAM with JMS-bc?

I looked at the example of su-jms-consume from the SVN source but the example appears to be outdated. The jbi.xml does not have a <petalsCDK:mep> tag which is required according to the JMS-bc documentation of June 2007.

Please help.




-------------------- m2f --------------------

Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=537#537

-------------------- m2f --------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://forum-list.petalslink.org/pipermail/users/attachments/20110316/495d34b3/attachment.htm>


More information about the Users mailing list