Peer Bech Hansen [
http://community.jboss.org/people/bech] created the discussion
"Does JBoss Messaging violate the JEE 5 Specification?"
To view the discussion, visit:
http://community.jboss.org/message/562832#562832
--------------------------------------------------------------
Hi JBoss people
For the project I’m currently working on, I’m trying to get JBoss Messaging to bridge
messages from a JBoss queue to a IBM WebSphere MQ queue.
I’m using IBM’s “WebSphere MQ resource adapter” and JCA administered objects to bind
remote WMQ queues to my local JNDI.
The guides I have followed, to configure the resource adaptor and to define my queues is
found here:
http://www.ibm.com/developerworks/websphere/library/techarticles/0710_rit...
http://www.ibm.com/developerworks/websphere/library/techarticles/0710_rit...
http://community.jboss.org/docs/DOC-12535
http://community.jboss.org/wiki/UsingWebSphereMQSeriesWithJBossASPart4
To Bridge the messages im using the *org.jboss.jms.server.bridge.BridgeService* MBean as
shown below:
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.jms.server.bridge.BridgeService"
name="jboss.messaging:service=Bridge,name=WMQBridge"
xmbean-dd="xmdesc/Bridge-xmbean.xml">
<!-- The JMS provider loader that is used to lookup the source destination
-->
<depends
optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
<!-- The JMS provider loader that is used to lookup the target destination
-->
<depends
optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSWMQProvider</depends>
<!-- The JNDI lookup for the source destination -->
<attribute
name="SourceDestinationLookup">queue/messagedistribution_contact_out</attribute>
<!-- The JNDI lookup for the target destination -->
<attribute
name="TargetDestinationLookup">queue/WMQTest_out</attribute>
<!-- Optional: The Quality Of Service mode to use, one of:
QOS_AT_MOST_ONCE = 0;
QOS_DUPLICATES_OK = 1;
QOS_ONCE_AND_ONLY_ONCE = 2; -->
<attribute name="QualityOfServiceMode">1</attribute>
<attribute name="MaxBatchSize">1</attribute>
<attribute name="MaxBatchTime">-1</attribute>
<attribute
name="FailureRetryInterval">5000</attribute>
<attribute name="MaxRetries">-1</attribute>
</mbean>
</server>der loader that is used to lookup the target destination -->
<depends
optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSWMQProvider</depends>
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.jms.server.bridge.BridgeService"
name="jboss.messaging:service=Bridge,name=WMQBridge"
xmbean-dd="xmdesc/Bridge-xmbean.xml">
<depends
optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
<depends
optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSWMQProvider</depends>
<attribute
name="SourceDestinationLookup">queue/messagedistribution_contact_out</attribute>
<attribute
name="TargetDestinationLookup">queue/WMQTest_out</attribute>
<attribute name="QualityOfServiceMode">1</attribute>
<attribute name="MaxBatchSize">1</attribute>
<attribute name="MaxBatchTime">-1</attribute>
<attribute
name="FailureRetryInterval">5000</attribute>
<attribute name="MaxRetries">-1</attribute>
</mbean>
</server>
When the bridging is performed i get the following error:
10:15:06,820 WARN [Bridge] jboss.messaging:name=WMQBridge,service=Bridge Failed to set up
connections
com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1031: The method can only be
called in the application client container. The application was not running in the
application client container when this method was called. Ensure that the application
runs in the application client container, or modify the application to avoid this method
call.
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.ConnectionWrapper.setExceptionListener(ConnectionWrapper.java:183)
at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:1017)
at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1223)
at org.jboss.jms.server.bridge.Bridge.access$1600(Bridge.java:68)
at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1569)
at java.lang.Thread.run(Thread.java:619)
The “WebSphere MQ resource adapter” fails; telling me that an illegal method has been
called.
On line 1017 and 1025 of the class *o*
*http://anonsvn.jboss.org/repos/messaging/tags/JBossMessaging_1_4_3_GA/src/main/org/jboss/jms/server/bridge/Bridge.java
rg.jboss.jms.server.bridge.Bridge*, the method setExceptionListener() is called on the on
the JMS ConnectionFactory.
On page 133 - 134 of the Java™ Platform, Enterprise Edition (Java EE) Specification, v5 (
http://jcp.org/aboutJava/communityprocess/final/jsr244/index.html
http://jcp.org/aboutJava/communityprocess/final/jsr244/index.html) it is clearly stated
that call to this method (and other methods), from web or EJB containers is prohibited.
The “WebSphere MQ resource adapter” has implemented this restriction and throws an
Exception if the method is call on their ConnectionFactory implementation.
So the questions is:
Isn’t JBoss Messaging violating the JEE5 specification, and how do I create a workaround
for the problem?
I have had the exact same error when using the JBoss ESB
http://community.jboss.org/thread/156545 http://community.jboss.org/thread/156545
Looking forward to hear your opinions.
Kind regards
Peer Bech Hansen
Logica Denmark
Environment used:
Microsoft Windows XP SP3
JBoss AS 5.1.0 GA
JBoss Messaging 1.4.3 GA
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/562832#562832]
Start a new discussion in JBoss Messaging at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]