ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » error MQJMS2005

Post new topic  Reply to topic
 error MQJMS2005 « View previous topic :: View next topic » 
Author Message
ch_nico
PostPosted: Wed Nov 08, 2006 4:31 am    Post subject: error MQJMS2005 Reply with quote

Newbie

Joined: 08 Nov 2006
Posts: 6

Hi,

I'm pretty new with MQSeries and I've got problems getting a QueueConnection from a java client, I've got the following error :
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'disedev:QM_MONA1R'

Environment :
Linux
MQSeries 5.3

I have a queue manager called QM_MONA1R created like this :
Code:
# crtmqm -ll -q QM_MONA1R


I was given a MQSC file to create queues and channels :
Code:
DEFINE CHANNEL(QM_HUB11R.QM_MONA1R) CHLTYPE(RCVR) REPLACE MAXMSGL(102400) BATCHSZ(50) HBINT(300) DESCR(' ')
DEFINE QLOCAL(MONA_PUB.IN.Q) REPLACE INITQ(' ') SHARE MAXDEPTH(200000) MAXMSGL(524288) PROCESS(' ') USAGE(NORMAL) TRIGGER TRIGTYPE(EVERY) DESCR(' ')
DEFINE QALIAS(MONA_PUB.IN) REPLACE TARGQ(MONA_PUB.IN.Q) DESCR(' ')
DEFINE QLOCAL(QM_MONA1R.INITCHL) REPLACE DESCR(' ') GET(ENABLED) DEFPSIST(YES)
START CHINIT INITQ(QM_MONA1R.INITCHL)


All the creations above are OK and the Queue Manager is started :
Code:

# strmqm QM_MONA1R
Purchased processor allowance not set (use setmqcap).
WebSphere MQ queue manager 'QM_MONA1R' started.


I've written a scp file (from which I suppose the error may come):
Code:

def ctx(jms)
chg ctx(jms)
def qcf(QM_MONA1R) channel(QM_HUB11R.QM_MONA1R) hostname(disedev) port(1415) qmgr(QM_MONA1R) transport(CLIENT) clientid(TESTJMSMQ) useconnpooling(Yes)
def q(MONA_PUB.IN) qmgr(QM_MONA1R) queue(MONA_PUB.IN) targclient(JMS)
dis ctx
end


The JMSAdmin configuration is defined as follow :
Code:

INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file:///var/mqm/bindings/jms


The Java client is defined like this :
Code:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:///var/mqm/bindings/jms");
try {
   InitialContext context = new InitialContext(env);
        Object o = context.lookup("QM_MONA1R");
        logger.debug("o = " + o.getClass());
        logger.debug("about to get the queue connection factory");
        QueueConnectionFactory qcf = (QueueConnectionFactory) context.lookup("QM_MONA1R");
        logger.debug("got the queue connection factory, qcf = " + qcf);
        QueueConnection connection = qcf.createQueueConnection();


Here is the full stack trace :
Code:

DEBUG|2006-11-08 13:11:18,935|o = class com.ibm.mq.jms.MQQueueConnectionFactory
DEBUG|2006-11-08 13:17:46,609|about to get the queue connection factory
DEBUG|2006-11-08 13:17:46,611|got the queue connection factory, qcf = com.ibm.mq.jms.MQQueueConnectionFactory@fdebb73c
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'disedev:QM_MONA1R'
        at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:569)
        at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2328)
        at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1749)
        at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:144)
        at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:54)
        at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:106)
        at com.capgemini.monaco.dise.stub.MQDiseGenerateMessageStub.doIt(MQDiseGenerateMessageStub.java:123)
        at com.capgemini.monaco.dise.stub.MQDiseGenerateMessageStub.main(MQDiseGenerateMessageStub.java:144)


The classpath of the client is defined like this :
Code:

/var/mqm/dev/testMQSeries/resources
/var/mqm/dev/testMQSeries/libs/com.ibm.mqbind.jar
/var/mqm/dev/testMQSeries/libs/com.ibm.mq.jar
/var/mqm/dev/testMQSeries/libs/com.ibm.mqjms.jar
/var/mqm/dev/testMQSeries/libs/connector.jar
/var/mqm/dev/testMQSeries/libs/fscontext.jar
/var/mqm/dev/testMQSeries/libs/jms.jar
/var/mqm/dev/testMQSeries/libs/jndi.jar
/var/mqm/dev/testMQSeries/libs/jta.jar
/var/mqm/dev/testMQSeries/libs/ldap.jar
/var/mqm/dev/testMQSeries/libs/log4j-1.2.8.jar
/var/mqm/dev/testMQSeries/libs/mq.dise.stub.jar
/var/mqm/dev/testMQSeries/libs/postcard.jar
/var/mqm/dev/testMQSeries/libs/providerutil.jar
/var/mqm/dev/testMQSeries/libs/rmm.jar


I think I'm wrong either in the scp file either I've forgotten to start/configure something in the MQSeries server.

Thx for any idea that could help me.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Nov 08, 2006 4:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Ok, there should be a linked exception which contains an MQ reason code:

Code:

catch (JMSException e){
System.out.println("Exception occurred: " +e.toString());
Exception ex = e.getLinkedException();
if(ex!=null)
System.out.println("Linked Exception is : "+ex);
}


In the absense of this, are you certain the id you're using has all the authorities you need? You've not posted a setmqaut script along with your other very commendable information.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Nov 08, 2006 4:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You are trying to connect a client to a Receiver Channel, I think.

You need to connect a client to a Server Connection channel.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
ch_nico
PostPosted: Wed Nov 08, 2006 5:39 am    Post subject: Reply with quote

Newbie

Joined: 08 Nov 2006
Posts: 6

Thx Vitor, here is the LinkedException :
Linked Exception is : com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused

I forgot to ask the network administrator to open the port 1415 on the firewall

And also thx to jefflowrey, the channel is not well configured. When I'm able to test, I hope it will work with CHLTYPE(SDR)

[Edit] inversion between Vitor and jefflowrey


Last edited by ch_nico on Wed Nov 08, 2006 5:58 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Nov 08, 2006 5:48 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ch_nico wrote:
When I'm able to test, I hope it will work with CHLTYPE(SDR)


I wouldn't put money on it.

I'd use an SVRCONN channel as jefflowrey suggests.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ch_nico
PostPosted: Wed Nov 08, 2006 5:55 am    Post subject: Reply with quote

Newbie

Joined: 08 Nov 2006
Posts: 6

oups, thx Vitor for the precision and sorry to have inverted the 2 names in my previous answer...
Back to top
View user's profile Send private message
ch_nico
PostPosted: Fri Nov 10, 2006 5:09 am    Post subject: Reply with quote

Newbie

Joined: 08 Nov 2006
Posts: 6

I still have some problems...

I have to use the 2 following mqsc files to generate queues and channels.
Code:

DEFINE QALIAS(A.MONA.PUB) REPLACE TARGQ(ARES.QR.MONA.QL.PUB) DESCR(' ')
DEFINE QREMOTE(ARES.QR.MONA.QL.PUB) REPLACE RNAME(MONA_PUB.IN.Q) RQMNAME(QM_MONA1R) XMITQ(QM_HUB11R) DESCR(' ')
DEFINE QLOCAL(QM_HUB11R) REPLACE MAXDEPTH(200000) MAXMSGL(524288) USAGE(XMITQ) TRIGGER TRIGTYPE(FIRST) TRIGDATA('ARES.QM_HUB11R') INITQ('QM.ARES.INITCHL') DESCR(' ')
DEFINE CHANNEL(ARES.QM_HUB11R) CHLTYPE(SDR) REPLACE DISCINT(0) SHORTRTY(10) SHORTTMR(60) LONGRTY(999999999) LONGTMR(1200) CONNAME('193.248.118.37(1515)') MAXMSGL(102400) TRPTYPE(TCP) XMITQ(QM_HUB11R) BATCHINT(0) BATCHSZ(50) HBINT(300) DESCR(' ')
DEFINE QLOCAL(QM.ARES.INITCHL) REPLACE DESCR(' ') GET(ENABLED) DEFPSIST(YES)
START CHINIT INITQ(QM.ARES.INITCHL)


Code:

DEFINE CHANNEL(QM_HUB11R.QM_MONA1R) CHLTYPE(RCVR) REPLACE MAXMSGL(102400) BATCHSZ(50) HBINT(300) DESCR(' ')
DEFINE QLOCAL(MONA_PUB.IN.Q) REPLACE INITQ(' ') SHARE MAXDEPTH(200000) MAXMSGL(524288) PROCESS(' ') USAGE(NORMAL) TRIGGER TRIGTYPE(EVERY) DESCR(' ')
DEFINE QALIAS(MONA_PUB.IN) REPLACE TARGQ(MONA_PUB.IN.Q) DESCR(' ')
DEFINE QLOCAL(QM_MONA1R.INITCHL) REPLACE DESCR(' ') GET(ENABLED) DEFPSIST(YES)
START CHINIT INITQ(QM_MONA1R.INITCHL)



I consume messages from the queue MONA_PUB.IN related to the channel of type RCVR.

On the client side, I have the following error when creating a QueueConnection from the QueueConnectionFactory :
Code:

Exception occurred: javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'disedev:QM_MONA1R'
Linked Exception is : com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009


On the server side I have these errors :
Code:

11/10/2006  01:59:18 PM
AMQ9519: Channel 'QM_HUB11R.QM_MONA1R' not found.

EXPLANATION:
The requested operation failed because the program could not find a definition
of channel 'QM_HUB11R.QM_MONA1R'.
ACTION:
Check that the name is specified correctly and the channel definition is
available.
----- amqrcdfa.c : 1081 -------------------------------------------------------
11/10/2006  01:59:18 PM
AMQ9999: Channel program ended abnormally.

EXPLANATION:
Channel program 'QM_HUB11R.QM_MONA1R' ended abnormally.
ACTION:
Look at previous error messages for channel program 'QM_HUB11R.QM_MONA1R' in
the error files to determine the cause of the failure.
----- amqrmrsa.c : 463 --------------------------------------------------------
11/10/2006  01:59:18 PM
AMQ9519: Channel 'QM_HUB11R.QM_MONA1R' not found.

EXPLANATION:
The requested operation failed because the program could not find a definition
of channel 'QM_HUB11R.QM_MONA1R'.
ACTION:
Check that the name is specified correctly and the channel definition is
available.
----- amqrcdfa.c : 1081 -------------------------------------------------------
11/10/2006  01:59:18 PM
AMQ9999: Channel program ended abnormally.

EXPLANATION:
Channel program 'QM_HUB11R.QM_MONA1R' ended abnormally.
ACTION:
Look at previous error messages for channel program 'QM_HUB11R.QM_MONA1R' in
the error files to determine the cause of the failure.
----- amqrmrsa.c : 463 --------------------------------------------------------



The channel is not found but it has been created via the mqsc script. Is there a specific command to start the channel ?
I've tried runmqlsr -t tcp -p 1414 -m QM_MONA1R but it's not enough.

thx.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 10, 2006 5:15 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You appear to have posted definitions for connecting two queue managers to each other. This is entirely irrelevant to connecting a client to a queue manager.

You cannot use SDR or RCVR channels for client connections.



You must use a SVRCONN.

You do not need to start the CHINIT, you do not need to define a special initq for the CHINIT.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Nov 10, 2006 5:21 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Are these definitions to link two queue managers so your Java has something to write to? If so, why do you think the channel names don't need to be the same? If you don't know what that's got to do with anything you have a flawed understanding of channels.

runmqlsr does not start channels - it does something else important. You'll find the information you need on starting channels in the same place as you found the DEFINE commands.

I think you need to spend some time with the books. This is basic, basic stuff and it gets much worse after this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ch_nico
PostPosted: Fri Nov 10, 2006 5:25 am    Post subject: Reply with quote

Newbie

Joined: 08 Nov 2006
Posts: 6

All right, the problem is I that I have to use these definitions of queue managers. They come from another application which posts messages.

As I have understood, the messages are posted on QM.ARES and redirected to QM_MONA1R. I am asked to consume the messages received on QM_MONA1R. If a client connection is not possible to do so, what else can I do ?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 10, 2006 5:32 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It's entirely possible to create a client connection to any queue manager.

You're just doing it almost entirely wrong.

And we've told you pretty much all you need to know already.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Nov 10, 2006 5:32 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ch_nico wrote:

As I have understood, the messages are posted on QM.ARES and redirected to QM_MONA1R. I am asked to consume the messages received on QM_MONA1R. If a client connection is not possible to do so, what else can I do ?


So you need to establish a client connection with QM_MONAIR. Eminently possible. The MQSC script you posted has nothing to do with establishing such a connection and everything to do with setting up a link from QM_HUB11R to QM_MONA1R. Incorrectly.

Separate these 2 tasks out. Define the client connection as jefflowrey has suggested, get that working then set up this (presumably test) environment.
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Fri Nov 10, 2006 5:45 am; edited 1 time in total
Back to top
View user's profile Send private message
ch_nico
PostPosted: Fri Nov 10, 2006 5:39 am    Post subject: Reply with quote

Newbie

Joined: 08 Nov 2006
Posts: 6

OK thx for your time, got some homework now...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » error MQJMS2005
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.