IBM Support

A JMS application is failing to get messages off a queue and receives MQJCA1025 error

Troubleshooting


Problem

A JMS application running in an application server fails to get messages from the WebSphere MQ queue. Error MQJCA1025 is logged.

Symptom

MQJCA1025: The message consumer must not have a message listener. An application attempted to set a message listener for a JMS message consumer. This exception occurs only if the application is running in a managed environment. Modify the application so that it does not use a message listener.
        at com.ibm.mq.connector.services.JCAExceptionBuilder.
buildException(JCAExceptionBuilder.java:149)
        at com.ibm.mq.connector.services.JCAExceptionBuilder.
buildException(JCAExceptionBuilder.java:86)
        at com.ibm.mq.connector.outbound.MessageConsumerWrapper.
setMessageListener(MessageConsumerWrapper.java:177)
        at org.apache.axis2.transport.jms.JMSConnectionFactory.
listenOnDestination(JMSConnectionFactory.java:458)
        at org.apache.axis2.transport.jms.JMSConnectionFactory.listen
(JMSConnectionFactory.java:421)
        at org.apache.axis2.transport.jms.JMSListener.start(JMSListener.
java:319)

Cause

Calling setMessageListener() method in a managed environment is a violation of J2EE specification, and therefore should not be used.

Environment

Any application server

Resolving The Problem

Your JMS application needs to be altered to not call setMessageListener() method. Instead, Activation Specifications are provided for the functionality which this method provides

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF021","label":"OpenVMS"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.0;7.5;7.1;7.0.1;7.0;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

WebSphere MQ WMQ

Document Information

Modified date:
15 June 2018

UID

swg21610734