Here in the UK, we quite often say things are like buses – you wait ages for one, and then two turn up at once. Well, the same is true of customers trying to do things with MQ. You can go for years without seeing anyone trying to use a piece of function, and then two customers come in asking the same questions about, or reporting issues with, that function at the same time.
Here’s a recent case in point.
A few months ago, a customer contacted IBM Support looking for help with using a third party security exit with JBoss EAP 7. They had deployed the WebSphere MQ V7.5 resource adapter into JBoss, and set up an activation specification to connect to a queue manager. A message-driven bean application had then been deployed into the application server, and was configured to use the activation specification. The message-driven bean application had the following annotations:
@ActivationConfigProperty(propertyName = "securityExit", propertyValue= "exits.SecurityExit") @ActivationConfigProperty(propertyName = "securityExitInit, propertyValue = "c:\\Exits\\SecurityExit.config")
which meant it would invoke the security exit exits.SecurityExit when it connected to the queue manager.
When the message-driven bean application started up, the WebSphere MQ resource adapter attempted to load the security exit and failed, which resulted in the following messages appearing in the JBoss log:
java.lang.RuntimeException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure. ........ Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'QM1' with connection mode 'Client' and host name 'myhost(1414)'. Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information. ........ Caused by: com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2406' ('MQRC_CLIENT_EXIT_LOAD_ERROR').
This was the first time IBM Support had come across someone trying to use a channel exit with JBoss. After some investigation it was found that the reason for the error was because the WebSphere MQ resource adapter could not find the JAR file that contained the exit exits.SecurityExit.
- The directories specified by the Java system property com.ibm.mq.cfg.ClientExitPath.JavaExitsClasspath.
- The directories specified by the JavaExitsClasspath entry in the Channels stanza of the MQ client configuration file (if the application server that the WebSphere MQ resource adapter had been deployed into was installed on the same system as an MQ client installation).
- The MQ exits directory (once again, if the application server that the WebSphere MQ resource adapter had been deployed into was installed on the same system as an MQ client installation).
The customer did not have an MQ client installation on the same as their JBoss EAP 7 installation, so they had to set the Java system property by adding the following entry to the Jboss standalone.xml configuration file:
<property name="com.ibm.mq.cfg.ClientExitPath.JavaExitsClasspath" value="C:\Exits\SecurityExit.jar"/>
Once they did this and restarted JBoss, the message-driven bean application started fine and was able to use the security exit.
A couple of weeks later, IBM Support received a call from another customer who had run into issues trying to use a receive exit with an activation specification – this time, the application server in question was WebSphere Application Server V8.5 rather than JBoss. They had configured the activation specification to load the receive exit via the WebSphere Administrative Console:
However, when an message-driven bean application that was configured to use the activation specification started up, a JMSException similar to the one mentioned above (containing an MQException reporting reason code 2406 – MQRC_CLIENT_EXIT_LOAD_ERROR) appeared in the application server’s SystemOut.log file. To resolve this, IBM Support had the customer set the Java system property com.ibm.mq.cfg.ClientExitPath.JavaExitsClasspath as a Generic JVM argument:
As a result of these PMRs, the documentation for using channel exits with the MQ resource adapter and classes for JMS have been updated, to make it clear that additional configuration (such as setting the Java system property ) is required in order for application servers and stand-alone Java application to be able to locate exits.