1 Define a Generic JMS Provider
- Set the classpath to list all necessary ActiveMQ jars under
${WAS_INSTALL_ROOT}/lib/ext (make sure to actually copy the jars there)
- Set the initial context factory to
org.activemq.jndi.ActiveMQWASInitialContextFactory
- Set the provider URL to the broker's URL,e.g. "reliable:tcp://host:port"
2- Configure a JMS Connection Factory for the newly defined provider,
e.g. jms/QueueConnectionFactory and/or jms/TopicConnectionFactory
3- Configure JMS destinations as needed, e.g. "MyQueue" and "MyTopic" as
external JNDI names
4- Set custom properties of the provider to map external JNDI names as
follows:
- java.naming.connectionFactoryNames = ConnectionFactory (whatever you
set as external JNDI name for the connection factory in step 2)
- java.naming.queue.MyQueue = MyQueue
- java.naming.topic.MyTopic = MyTopic
5- Create a Message Listener Port for message-driven beans:
- Set the connection factory JNDI, e.g. "jms/QueueConnectionFactory"
- Set the destination JNDI, e.g. "jms/MyQueue"
6- Restart WAS
but when I re-started websphere, the following error is appeared:
####### error ##########
Content: JndiLookupInfo: jndiName="MyReceiveQueue"; providerURL="tcp://localhost:61616"; initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
Address Type: IndirectJndiLookupAdditionalProperties
AddressContents: ffffffac ffffffed 0 5 73 72 0 14 6a 61 76 61 2e 75 74 69 6c 2e 50 72 6f 70 65 72 74 69 65 73 39 12 ffffffd0 7a ...
Exception data follows:
javax.naming.NameNotFoundException: MyReceiveQueue
at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:225)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:375)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:221)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:893)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:705)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:2093)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1947)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1862)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1552)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1354)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at com.ibm.ejs.jms.listener.MDBListenerImpl.createResources(MDBListenerImpl.java:235)
at com.ibm.ejs.jms.listener.MDBListenerImpl.internalStart(MDBListenerImpl.java:727)
at com.ibm.ejs.jms.listener.MDBListenerImpl.restart(MDBListenerImpl.java:700)
at com.ibm.ejs.jms.listener.MDBListenerImpl.alarm(MDBListenerImpl.java:1035)
at com.ibm.ejs.util.am._Alarm.run(_Alarm.java:90)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
###############################
Could anyone tell me what's the error, do I need to do some extra work on ActiveMQ end or Websphere End.
Thanks.
This is only a guess but have you checked that MyReceiveQueue is defined in the JNDI namespace which you are pointing
to? The exception you are getting implies that it is not.
Cheers, Matt.
As you said, where and how I can define JNDI namespace, should be on Websphere admin or on ActiveMQ end. could you please tell me more detail, thanks advance.
The problem could be in either your WAS or ActiveMQ configuration. I have never used ActiveMQ before but here are the steps I suggest:
1) Check that tcp://localhost:61616 is the right providerUrl to use. If not you would need to change your WAS configuration
2) Check that MyReceiveQueue is defined in the JNDI name space pointed to by tcp://localhost:61616. If it is then something weird has gone wrong. If not then you will need to create it in ActiveMQ (something I can't help with) or alternatively use a name that does exist by adjusting your WAS configuration
Regards, Matt.