File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes WSAD5.1.3 remote MQv5.3 connection and listen using MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "WSAD5.1.3 remote MQv5.3 connection and listen using MDB" Watch "WSAD5.1.3 remote MQv5.3 connection and listen using MDB" New topic
Author

WSAD5.1.3 remote MQv5.3 connection and listen using MDB

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
I can successfully run MDB to listen for messages and use session bean to put messages in a queue using WSAD5.1.3 and MQ Simulator (part of WSAD Test Server).

However, I want to connect to an external MQ box (AIX platform, OS version 5.2) that is running MQ5.3 with fix pack CSD08 from my local windows WSAD box, running WSAD 5.1.2 by configuring WSAD Test server.

I made following configurations in WSAD Test Server:
listener port, EBj, Security

I made following config in WSAD using Admin Console:
QueueFactory, QueueName, Channel etc for Websphere MQ JMS provider tab.

I can additionally connect to the external MQ box from my local Windows machine.

However, when I start WSAD Test server, I get exceptions:

Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jms/qFactory, throwing ResourceAllocationException. Original exception: javax.resource.spi.ResourceAdapterInternalException: createQueueConnection failed
at com.ibm.ejs.jms.JMSCMUtils.mapToResourceException(JMSCMUtils.java:125)
at com.ibm.ejs.jms.JMSManagedQueueConnection.createConnection(JMSManagedQueueConnection.java:193)
at com.ibm.ejs.jms.JMSManagedConnection.<init>(JMSManagedConnection.java:193)
at com.ibm.ejs.jms.JMSManagedQueueConnection.<init>(JMSManagedQueueConnection.java:65)

....................
.......................
Next Linked Exception:
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'myHost-01d:myQueueMgr'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:546)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:1450)
at com.ibm.mq.jms.MQConnection.createQMXA(MQConnection.java:915)
..................................
...................................

Next Linked Exception:
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2059

..........................
.........................
[4/18/05 16:50:06:594 EDT] 3d4b491e ConnectionMan E J2CA0020E: The Connection Pool Manager could not allocate a Managed Connection: javax.resource.spi.ResourceAllocationException: createQueueConnection failed
at com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1351)
...........................
...........................
---- Begin backtrace for Nested Throwables
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'myHost-01d:myQueueMgr'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:546)
.....................
.....................
---- Begin backtrace for Nested Throwables
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2059

.....................
.....................
[4/18/05 16:50:06:609 EDT] 3d4b491e MDBListenerIm W WMSG0019E: Unable to start MDB Listener MyMDBean, JMSDestination jms/SAM.TEST : javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'myHost-01d:myQueueMgr'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:546)
david lightman
Ranch Hand

Joined: Nov 03, 2004
Posts: 82
you cannot connect to a remote system using the embedded messaging provider with WSAD. You must use the full MQ websphere 5.3 server to connect to an external remote queue manager.
Joseph Marques
Greenhorn

Joined: May 01, 2005
Posts: 12
My system is as follows:
WSADIE v5.1.1 with WMQ 5.3.9

I want to set up my development environment to use external MQ. However, when I configure the queue and queue manager resources I get the following nested exceptions:

J2CA0020E: The Connection Pool Manager could not allocate a Managed Connection:
...
javax.resource.spi.ResourceAllocationException: createQueueConnection failed
...
javax.resource.spi.ResourceAdapterInternalException: createQueueConnection failed
...
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'localhost:WAS_localhost_server1'
...
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
...
MQJE011: Socket connection attempt refused
...
Caused by: com.ibm.mqservices.MQInternalException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
...
MQJE011: Socket connection attempt refused

Since the dev env and the MQ are both on the same box, I know they can communicate in a simplified way. So, when I created these resources I left the channel, host, and port all empty, because I did not need to switch from bindings to client mode.

Now, I even tried the suggestion from glbondy, but that didn't seen to help, so I ended up changing my queue manager from host_name to localhost.

One question I have is why the name of the queue manager in the exception is 'localhost:WAS_localhost_server1' instead of simply 'WAS_localhost_server1'.

On last thing, I have operating system security turned on. But, again, I think this issue falls away because I'm using the pieces all on the same box. WMQ should assume that, since the request isn't coming across from a remote client, that the caller is already authenticated.

Any and all help would be greatly appreciated.

-joe
Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
I had success in connection to Remote MQ box from my local WSAD Test server. JMS radio button has to be disabled in WSAD Test Server configurations. All other configurations. You need at a minimal MQ Client (not full client and Server) in your local machine to connect to remote MQ box. All configurations in WSAD have to be done via Admin console. Thhe configuratiuons necessary in WSAD is the same as if you were using WAS box instead to connect to remote queue.
Settings required are:
A) Disable JMS in WSAD Test Server.
B) Enable Admin console in WSAD Test Server.

Open Admin Console of WSAd Test Server. Do the following configurations:

1) Add a Variable to point to the location of MQ Client in your local box(need to install MQ client in local WSAD/WAS box).
2) Add Message Listener though Listener Port link
3) Configure Connection Factory
4) Configure Queue

You need to know Channel information.

The same setting can be done in WAS box (also in WSAD) to connect to remote queue.
Joseph Marques
Greenhorn

Joined: May 01, 2005
Posts: 12
I had success in connection to Remote MQ box from my local WSAD Test server.

>> I'm trying to connect to MQ on the same box, which is why "bindings" mode is allowed, instead of "client" mode. Bindings then relieve the administrator from providing a channel, port, and host.

JMS radio button has to be disabled in WSAD Test Server configurations. All other configurations.

>> Yup, everything is definitely disabled on the JMS tab in the server configuration.

You need at a minimal MQ Client (not full client and Server) in your local machine to connect to remote MQ box.

>> Hmm...this makes me question something: How exactly does the app server communicate to MQ if they are both on the same box? I would like to assume that it shouldn't need the client to be installed at all, but I suppose I should look it up just to be sure.

All configurations in WSAD have to be done via Admin console. Thhe configuratiuons necessary in WSAD is the same as if you were using WAS box instead to connect to remote queue.
Settings required are:
A) Disable JMS in WSAD Test Server.
B) Enable Admin console in WSAD Test Server.

>> yup, did that

Open Admin Console of WSAd Test Server. Do the following configurations:

1) Add a Variable to point to the location of MQ Client in your local box(need to install MQ client in local WSAD/WAS box).
2) Add Message Listener though Listener Port link
3) Configure Connection Factory
4) Configure Queue

>> Yup, I did all of that too. One question: is it OK if the location of my MQ variable has spaces in the directory name?

You need to know Channel information.

The same setting can be done in WAS box (also in WSAD) to connect to remote queue.
 
wood burning stoves
 
subject: WSAD5.1.3 remote MQv5.3 connection and listen using MDB
 
Similar Threads
hi kyle
createQueueConnection failed
Not able to connect to MQQueueManager using WAS6.0, RAD and Websphere MQ
MDB-MQ
Run stand alone JMS client ...