Configuration of remote ActiveMQ with genericra in glassfish not working!!!
Software stack: Glassfish 3.1.1 and genericra 2.1, ActiveMQ 5.6.0
Requirement: Configure ActiveMQ JMS Provider, Create a queue in ActiveMQ, Send a message asynchronously from glassfish app to that queue and write a MDB to receive messages from that queue.
Steps followed to configure remote
1. Downloaded and installed ActiveMQ on windows.
2. Downloaded and deployed the genericra - generic jms resource adapter in glassfish.
Understanding was that using genericra, it becomes a generic solution from application. If activemq adapter is used, it becomes very tightly coupled. Any new JMS providers, we have to redo lot of things. Correct me if I am wrong.
3. Created a resource adapter config object for the same. This resource adapter config has the brokerURL which says tcp://localhost:616161 (Hope it is fine?)
Created Connectionfactory and Destination resources in glassfish. Under glassfish admin console, created a Connector Connection Pool, Connection Factory and Destination Resource by specifying the JNDI Name. Every time, we select the resource adapter as genericra during this. So I assume these connection factory and destination are created in glassfish and point to the ActiveMQ through generic ra. So we are not creating and referring locally to OpenMQ. Am I right?
Should we not use / in JNDI name or name of Queue/topic/ConnectionFactory?
PhysicalName property specified while creating administered object queue, will ideally should create a Physical Destination in remote ActiveMQ. Rt?
Created a queue in ActiveMQ admin console with same name as JNDI name of administered object in glassfish. Now a question here - Creating a queue in ActiveMQ console will create only a Physical Destination rt? Because, we hv created the destination with a JNDI name in glassfish.
A sample program written to connect to queue and send message from glassfish app. With this, my question here is, I have just said new InitialContext() i.e. without any ActiveMQ provider URLs. But i am able to look up connectionfactory and queue using JNDI. How is it working? I was thinking I have to pass hashtable values with remote ActiveMQ urls to create it.
Even though there is no error in look up of conn factory and queue, it fails in statement session.createProducer(destination) with nullpointer exception
at org.apache.activemq.command.ActiveMQDestination.hashCode(ActiveMQDestination.java:329) at java.util.HashMap.get(HashMap.java:300) Not sure how to proceed??
Simple MDB program configuration in glassfish.
Apart from writing MDB with annontation, what additional xml files to be configured? Lot of places talk about ejb-jar.xml, glassfish-ejb-jar.xml files. Some placed I saw even glassfish-resources xml file. What are the mandatory configuration files?
Extract of glassfish server log error when MDB deployed with glassfish-ejb-jar.xml
[#|2012-07-20T16:32:12.402+0530|INFO|glassfish3.1|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=17;_ThreadName=Thread-1;|MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter: Version: 4.5 (Build 29-b) Compile: Wed Feb 9 22:53:30 PST 2011|#]
[#|2012-07-20T16:32:12.403+0530|INFO|glassfish3.1|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=17;_ThreadName=Thread-1;|MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter starting: broker is EMBEDDED, connection mode is Direct|#]
[#|2012-07-20T16:32:13.130+0530|INFO|glassfish3.1|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=17;_ThreadName=Thread-1;|MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter Started:EMBEDDED|#]
[#|2012-07-20T16:32:13.134+0530|SEVERE|glassfish3.1|javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system|_ThreadID=65;_ThreadName=Thread-1;|Missing Destination JNDI Name|#]
[#|2012-07-20T16:32:13.135+0530|SEVERE|glassfish3.1|javax.enterprise.system.util.com.sun.enterprise.util.i18n|_ThreadID=65;_ThreadName=Thread-1;|UTIL6550: Error in local string manager - resource bundle is probably missing.
java.util.MissingResourceException: Can't find bundle for base name com.sun.enterprise.connectors.jms.system.LocalStrings, locale en_US
By seeing this log, I am getting confused whether it is using internal jmsra instead of genericra which i have specified in glassfish-ejb-jar xml file.
I am really a newbie to JMS core implementations. Sorry if the questions are too basic. Waiting for the feedback to my questions...