Author |
Message
|
creacker |
Posted: Wed Dec 03, 2008 8:01 pm Post subject: Exception during the createQueueConnection |
|
|
Novice
Joined: 02 Dec 2008 Posts: 11
|
Hi,
I'm trying to connect to my local Websphere MQ server using the jms library but I have an exception...
My code
Code: |
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
try {
factory.setQueueManager("QMGR");
factory.setHostName("localhost");
factory.setPort(1414);
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
connection = factory.createQueueConnection();
}
|
My Exception
Code: |
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'localhost:QMGR'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:586)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2110)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1532)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:150)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:185)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:112)
|
And my server is running, i can connect it using the ibm library...
Anyone knows what I've done wrong ?
Thank you |
|
Back to top |
|
 |
atheek |
Posted: Wed Dec 03, 2008 8:37 pm Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
You didn't specify the SVRCONN channel to be used to connect in client mode. |
|
Back to top |
|
 |
creacker |
Posted: Wed Dec 03, 2008 9:20 pm Post subject: |
|
|
Novice
Joined: 02 Dec 2008 Posts: 11
|
I'm working in a local server, I'm not connecting to a remote server.
What value should I put in the SVRCONN channel value ???
Thank you for your help |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 04, 2008 12:48 am Post subject: Re: Exception during the createQueueConnection |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
creacker wrote: |
Anyone knows what I've done wrong ? |
You've not captured the linked exception. This contains the reason code thrown by WMQ and indicates the specific problem, rather than this generic "well I tried to create it and something bad happened" message.
Change your code, capture the linked exception, look up the reason code you get and resolve the problem that you've actually got.
Remembering always that it might not be a problem with your code at all but your environment. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Dec 04, 2008 1:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you wish to establish a bindings connection, you must only specify a queue manager name.
If you wish to establish a client connection, you must only specify a channel, hostname and port and not specify a qmgr name. |
|
Back to top |
|
 |
creacker |
Posted: Thu Dec 04, 2008 8:43 am Post subject: Re: Exception during the createQueueConnection |
|
|
Novice
Joined: 02 Dec 2008 Posts: 11
|
Vitor wrote: |
creacker wrote: |
Anyone knows what I've done wrong ? |
You've not captured the linked exception. This contains the reason code thrown by WMQ and indicates the specific problem, rather than this generic "well I tried to create it and something bad happened" message.
Change your code, capture the linked exception, look up the reason code you get and resolve the problem that you've actually got.
Remembering always that it might not be a problem with your code at all but your environment. |
Here is my linked exception
Code: |
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2046
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:219)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:179)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:215)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:84)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:168)
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:772)
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:697)
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:657)
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:153)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:526)
at com.ibm.mq.MQSPIQueueManager.<init>(MQSPIQueueManager.java:69)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2035) |
I see that Error 2046 is an option problem... How can i define the options and which one i have to use ?
mqjeff wrote: |
If you wish to establish a bindings connection, you must only specify a queue manager name.
If you wish to establish a client connection, you must only specify a channel, hostname and port and not specify a qmgr name.
|
I've tried this to connect to my local queue
Code: |
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
try {
factory.setQueueManager("QMGR");
connection = factory.createQueueConnection();
}
|
but still have the issue ...
Thanks for your help |
|
Back to top |
|
 |
creacker |
Posted: Thu Dec 04, 2008 9:38 am Post subject: |
|
|
Novice
Joined: 02 Dec 2008 Posts: 11
|
I found my error : I was using 6.0 jar, and my server is a 5.3.
i'm a little bit surprise that there is no backward compatibility...
Thank you for you help |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Dec 04, 2008 11:24 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
There is compatability between those versions of MQ. If your problem went away when you changed versions that's purely coincidental and not the root cause for a 2046 MQ Reason Code. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Dec 04, 2008 3:01 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
creacker wrote: |
I'm working in a local server, I'm not connecting to a remote server.
What value should I put in the SVRCONN channel value ???
Thank you for your help |
Quote: |
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); |
It matters little whether your server is local or remote.
You are trying to access it through a client connection.
Read the clients manual and the programers manuals and the using java manual  _________________ MQ & Broker admin |
|
Back to top |
|
 |
creacker |
Posted: Fri Dec 05, 2008 11:34 am Post subject: |
|
|
Novice
Joined: 02 Dec 2008 Posts: 11
|
fjb_saper wrote: |
There is compatability between those versions of MQ. If your problem went away when you changed versions that's purely coincidental and not the root cause for a 2046 MQ Reason Code. |
PeterPotkay wrote: |
creacker wrote: |
I'm working in a local server, I'm not connecting to a remote server.
What value should I put in the SVRCONN channel value ???
Thank you for your help |
Quote: |
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); |
It matters little whether your server is local or remote.
You are trying to access it through a client connection.
Read the clients manual and the programers manuals and the using java manual  |
Ok, so according to the IBM documentation(http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj28880_.htm), i can use one of this parameters:
* JMSC.MQJMS_TP_BINDINGS_MQ
* JMSC.MQJMS_TP_CLIENT_MQ_TCPIP
* JMSC.MQJMS_TP_MQJD
* JMSC.MQJMS_TP_DIRECT_TCPIP
* JMSC.MQJMS_TP_DIRECT_HTTP
I try this
Code: |
factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
|
but still have the 2046 error, error that I don't have if I use the 5.3 jars... |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 05, 2008 2:08 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
try {
factory.setQueueManager("QMGR");
factory.setHostName("localhost");
factory.setPort(1414);
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
connection = factory.createQueueConnection();
} |
I believe V6 is more strict on the setup of the QCF. So if you specify bindings mode for transport you may not be allowed to specify host and port, and obviously if you specify client mode you MUST also specify the channel ...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
creacker |
Posted: Mon Dec 08, 2008 5:41 pm Post subject: |
|
|
Novice
Joined: 02 Dec 2008 Posts: 11
|
fjb_saper wrote: |
I believe V6 is more strict on the setup of the QCF. So if you specify bindings mode for transport you may not be allowed to specify host and port, and obviously if you specify client mode you MUST also specify the channel ...  |
I try that
Code: |
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
factory.setQueueManager("QMGR");
factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
connection = factory.createQueueConnection();
|
but still have the issue
I believe that I have to use a different library depending of the MQ Websphere server version installed |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 08, 2008 7:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
creacker wrote: |
fjb_saper wrote: |
I believe V6 is more strict on the setup of the QCF. So if you specify bindings mode for transport you may not be allowed to specify host and port, and obviously if you specify client mode you MUST also specify the channel ...  |
I try that
Code: |
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
factory.setQueueManager("QMGR");
factory.setTransportType(JMSC.MQJMS_TP_BINDINGS_MQ);
connection = factory.createQueueConnection();
|
but still have the issue
I believe that I have to use a different library depending of the MQ Websphere server version installed |
You never specified the CSD for your 5.3 server installation. I would not try to connect to anything below CSD 11, anyways 5.3 is out os support, upgrade to 6.0.2.5 or V7 already!
A few additional pointers:
With 5.3 in bindings mode => you are on the same box as the server you should use the same level java client as the server.
Using a java client in client mode you can only get an XAqcf/XAtcf if you have also the mqetc.jar on the classpath.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
creacker |
Posted: Tue Dec 09, 2008 11:39 am Post subject: |
|
|
Novice
Joined: 02 Dec 2008 Posts: 11
|
fjb_saper wrote: |
You never specified the CSD for your 5.3 server installation. I would not try to connect to anything below CSD 11, anyways 5.3 is out os support, upgrade to 6.0.2.5 or V7 already! |
I need to use my code for both 5.3 and 6.0. I don't know very well how to know my CSD, but i found that in the memo.ptf
Quote: |
COMPONENT_NAME: WebSphere MQ
FILE: MEMO.PTF
Program Number 5724-B41
This memo.ptf file contains information you need for updating either
IBM WebSphere for Windows V5.3 (server and/or client), as well as a
summary of the contents of the latest CSD and any earlier CSDs.
This memo.ptf file corresponds to the first CSD, which is defined as
PTF U200181 and is numbered 01. The first CSD will bring your
WebSphere MQ for Windows Version 5.3 installation up to service level
U200181 (CSD01).
|
fjb_saper wrote: |
A few additional pointers:
With 5.3 in bindings mode => you are on the same box as the server you should use the same level java client as the server.
Using a java client in client mode you can only get an XAqcf/XAtcf if you have also the mqetc.jar on the classpath.
Have fun  |
I'm sorry but I'm not familiar with MQ and i'm sot sure to understand very well:
i have to use binding mode to connect to a local server, and tcp in client mode if I want to connect to a remote server right ?
fjb_saper wrote: |
Using a java client in client mode you can only get an XAqcf/XAtcf if you have also the mqetc.jar on the classpath.
Have fun  |
Why do I have to use mqetc.jar ?
With jars 5.3, I use com.ibm.mq.jar, connector.jar and com.ibm.mqjms.jar
With jars 6.0, i use the same jar (in 6.0 version) + dhbcore.jar.
Am i using the right jars ? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 09, 2008 12:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
etc stands for Extended Transactional Client.
Using a client connection without the etc.jar will not allow you to get an XA connection factory. Should you try for an XA connection factory you will get a runtime exception.
Exceptions: WAS V6.0 and above which uses its own client.
Note that the MQ Resource adapter came with 6.0.2.3 and above. And it is only recently that there is no extra fee for the ETC client.
Have fun.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|