1

I need to map WebSphere MQ7 queue (Say queA in Queue Manager QMA) to a EJB3 MDB.

I created the MQ Queue Manager and Queue using
crtmqm QMA and start it using strmqm MQA
Then i wrote a file file name QMA.conf and included
DEFINE QLOCAL ('queA')
line it and run the command
runmqsc QMA < QMA.conf
then I run
strmqcsv MQA &
runmqlsr -m QMA -t TCP &
All these steps done as mqm logged user.

Then I follow http://community.jboss.org/wiki/JBossEAP5IntegrationwithWebSphereMQ link and configure RAR to the jboss 5.1. When I run the test connection that also succeeded.

There I include

* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT

and In my MDB I include

@MessageDriven( name="WMQMDBTest",
        activationConfig = 
        { 
            @ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),
            @ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
            @ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
            @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
            @ActivationConfigProperty(propertyName = "channel", propertyValue = "SYSTEM.DEF.SVRCONN"),
            @ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),
            @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QMA"),
            @ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
            @ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
            @ActivationConfigProperty(propertyName = "username", propertyValue = "mqm"),
            @ActivationConfigProperty(propertyName = "password", propertyValue = "password")
        }) 
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@ResourceAdapter(value = "wmq.jmsra.rar")

When I try to deploy the bean it says

DEPLOYMENTS IN ERROR:
  Deployment "jboss.j2ee:ear=integration-1.0-SNAPSHOT.ear,jar=business-logic-1.0-SNAPSHOT.jar,  
  name=WMQMDBTest,service=EJB3" is in error due to the following reason(s): 
javax.naming.NameNotFoundException: queA not bound
MaDa
  • 10,511
  • 9
  • 46
  • 84
Asanga
  • 11
  • 1
  • 2
  • Have you verified that queA actually exists in QMA? I read that you created a script to define it but not that you verified it exists either by displaying it in runmqsc or by looking at it in WMQ Explorer. – T.Rob Jun 09 '11 at 21:19
  • Yes Queue is available in the WQM. – Asanga Jun 10 '11 at 13:10
  • Well, that's a start. Unfortunately that's as far as I go. I don't see anything in the WMQ parts of this that would prevent your connection and I don't know JBoss config. The one thing I'll offer is that if you have installed the full WMQ client (instead of just grabbing the jar files) then you can use the sample programs to validate your connection. If you can use the existing WMQ config to connect using amqsputc then you have narrowed the problem down to the JBoss config. Of course if all you did was grab the jars then you are EXTREMELY limited as to what diagnostics you can perform. – T.Rob Jun 10 '11 at 15:16
  • I've updated the tags to include [tag:jboss] so this question will get more visibility from that group of folks. Hopefully that will produce an actual answer. :-) – T.Rob Jun 10 '11 at 15:19

1 Answers1

2

You've written

        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),

with the useJNDI property implying that 'queA' is the name under which the JMS Queue is bound into the JNDI namespace - this does not directly correspond to the queue you have defined here

DEFINE QLOCAL ('queA')

If you want it to refer to a physical WMQ queue on your queue manager then you need the useJNDI property set to false, in which case destination specifies the name of a queue on the queue manager, not a JNDI name. On the other hand, if you do want to use JNDI lookup of Destinations then you need to ensure that the destination name specified matches the Queue definition in the -ds.xml file, e.g.

        @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/request")

would correspond to

<mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=request_queue">
    <attribute name="JNDIName">jms/request</attribute>
    <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
    <attribute name="Type">javax.jms.Queue</attribute>
    <attribute name="Properties">
        baseQueueManagerName=QMA            
        baseQueueName=queA
    </attribute>
</mbean>

note the JNDIName attribute of the mbean corresponds to the destination name

strmqm
  • 1,274
  • 1
  • 9
  • 17