Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Abstract

This troubleshooting guide helps you resolve common problems encountered in JMS integration scenarios with WSO2 ESB.

...

WSO2 ESB comes with geronimo-jms library, which contains the javax.jms packages. Therefore, you do not have to deploy them again.  

Back to Top ^

...

HTTP

...

header conversion

When forwarding HTTP traffic to a JMS queue using WSO2 ESB, you might get an error similar to the one given below.  

Code Block
ERROR JMSSender Error creating a JMS message from the axis message context
javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: Content-Type
 

This exception is specific to the JMS broker used, and is thrown by the JMS client libraries used to connect with the JMS broker.
 
The incoming HTTP message contains a bunch of HTTP headers that have the ‘-‘ character. Some noticeable examples are Content-length and Transfer-encoding headers. When WSO2 ESB forwards a message over JMS, it sets the headers of the incoming message to the outgoing JMS message as JMS properties. But, according to the JMS specification, the ‘-‘ character is prohibited in JMS property names. Some JMS brokers like ActiveMQ do not check this specifically, in which case there will not be any issues. But some brokers do and they throw exceptions. 

...

Code Block
languagehtml/xml
<property action="remove" name="Content-Length" scope="transport">
<property action="remove" name="Accept-Encoding" scope="transport">
<property action="remove" name="User-Agent" scope="transport">
<property action="remove" name="Content-Type" scope="transport"> 

Back to Top ^

...

JMS

...

property data type mismatch

 When the ESB attempts to forward a message over JMS, there are instances that the client libraries throw an exception saying the data type of a particular message property is invalid.
 
This problem occurs when the developer uses the property mediator to manipulate property values set on the message. Certain implementations of JMS have data type restrictions on properties. But the property mediator always sets property values as strings.

...

Code Block
languagehtml/xml
<property name="foo" value="12345" type="INTEGER" scope="transport/"> 

Back to Top ^

...

Too-

...

many-

...

threads and

...

out-of-

...

memory issues

 With some JMS brokers, WSO2 ESB tends to spawn new worker threads indefinitely until it runs out of memory and crashes. This problem is caused by a bug in the underlying Axis2 engine. A simple workaround to this problem is to engage the property mediator of the mediation sequence as follows:  

...

This prevents the ESB from creating new worker threads indefinitely. You can use a jconsole like JMX client to monitor the active threads and memory consumption of the ESB.

Back to Top ^

...

JMSUtils cannot locate destination

If your topic or queue name contains the termination characters ":" or "=", JMSUtils will not be able to find the topic/queue and will give you the warning "JMSUtils cannot locate destination". (For more information, see http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.Reader%29.) For example, if the topic name is my::topic, the following configuration will not work, because the topic name will be parsed as my instead of my::topic:

<address uri="jms:/my::topic?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=repository/conf/jndi.properties&amp;transport.jms.DestinationType=topic"/>

To avoid this issue, you can create a key-value pair in the jndi.properties file that maps the topic/queue name to a key that either escapes these characters with a backslash (\) or does not contain ":" or "=". For example:

topic.my\:\:topic = my::topic

or

topic.myTopic = my::topic

You can then use this key in the proxy service as follows:

<address uri="jms:/my\:\:topic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=repository/conf/jndi.properties&amp;transport.jms.DestinationType=topic"/>

If you do not want to use the JNDI properties file, you can define the key-value pair right in the proxy configuration:

<address uri="jms:/my\:\:topic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;topic.my\:\:topic=my::topic&amp;java.naming.provider.url=repository/conf/jndi.properties&amp;transport.jms.DestinationType=topic"/>

Back to Top ^