I am attempting to configure the IBM MQ Resource Adapter (MQ-RA) inside of WebLogic Server for inbound messaging to a message-driven bean (MDB) from an MQ Queue Manager (QMgr) via an Activation Specification (ActSpec) provided by the MQ-RA.
The problem I am hitting is that the activation-config-property
XML definitions (specifically ConnectionFactoryLookup and DestinationLookup) I have specified in my ejb-jar.xml deployment descriptor for my MDB are not being set by WebLogic on the ActSpec object provided by the MQ-RA. As such, when the MDB is deployed and WebLogic calls endpointActication
as per the JCA spec, it is unable to connect to the MQ Queue Manager (QMgr) - because it is trying to connect using the default connection options and not the ones defined in the JNDI CF referenced by the ConnectionFactoryLookup property.
My understanding is that the EJB container (WebLogic) should be providing the MQ-RA with a configured ActSpec that has had the configuration information set on it, based on the activation-config-property
entries, when creating/activating the message endpoint instance.
So my question:
Why are these activation-config-property
entries in the ejb-jar.xml file not being set on the ActSpec created from the MQ-RA?
(Slight aside: If I deploy a simple Servlet application for outbound messaging, then this all works great and the EJB application uses the deployed MQ-RA to send messages to an MQ QMgr after looking up a ConnectionFactory and Destination from JNDI. So it looks as though the MQ-RA is deployed okay and its classes available.)
Below, I'll explain how I've set up WebLogic server thus far and how I've deployed my EJB apps and the MQ-RA. If anyone can off some advice or a nudge in the right direction so that I can deploy my MDB application against the MQ-RA in WebLogic successfully, that would be greatly appreciated! :-)
Product Versions Used:
WebLogic V12.2.1.2.0
MQ Server and RA V9.0.0.0
Configuration Steps Taken:
- Created a file based JNDI store (.bindings) to hold an MQ JMS ConnectionFactory and MQ JMS Destination object.
- Defined a "Foreign JNDI Provider" in WLS with the initial context factory "com.sun.jndi.fscontext.RefFSContextFactory" that points at my .bindings file.
- Created two Foreign JNDI Links with a local JNDI name (jms/CF and jms/Dest) mapping to the remote JNDI names in my .bindings file.
- Deployed the MQ-RA (via the Install button on the WLS Admin Console) "as an application" (not a library), giving it the JNDI name "mqrajndi" and setting "Global Access To Classes Enabled" to true.
The following is a snippet from the ejb-jar.xml for the MDB app to be deployed showing the
activation-config-property
set an child elements of themessage-driven
parent.:<activation-config> <activation-config-property> <activation-config-property-name>DestinationLookup</activation-config-property-name> <activation-config-property-value>jms/Dest</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>ConnectionFactoryLookup</activation-config-property-name> <activation-config-property-value>jms/CF</activation-config-property-value> </activation-config-property> </activation-config>
In the weblogic-ejb-jar.xml file accompanies the ejb-jar.xml, I bind the MDB to the MQ-RA using the JNDI name I specified after deploying the MQ-RA:
<weblogic-enterprise-bean> <ejb-name>BASIC_MDB</ejb-name> <message-driven-descriptor> <resource-adapter-jndi-name>mqrajndi</resource-adapter-jndi-name> </message-driven-descriptor> </weblogic-enterprise-bean>
Deploy the MDB, as an application, and observe it cannot connect to my QMgr during the
endpointActivation
call with the exception JMSWMQ0018: Failed to connect to queue manager '' with connection mode 'Client' and host name 'localhost(1414)'.
JMSWMQ0018
error you observed? Does the queue managers AMQERR01.LOG have anything at the same time you attempt to connect? – JoshMc