Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javax.jms.InvalidDestinationException: MQJMS0003

Status
Not open for further replies.

ondrabab

Programmer
Nov 4, 2004
4
CZ
Hi,

I'm becoming desperate because of this problem. If you have any idea please post it here.


I develop a web application which is intended to communicate with other apps via MQ. I work in Websphere Studio AD 5.0 and the application should run on Websphere Application Server 5.1. WAS should act only as a MQ client - the provider is Websphere MQ 5.3 CSD09 running on the same machine.


For working with MQ I have a class called MQAccessor, which has a sender (a QueueSender object), a receiver (a QueueReceiver) and a browser (a QeueBrowser). It initializes these objects in its constructor. For this it uses a QueueConnectionFactory object and Queue objects held on the server and accessible through JNDI.
The important part of the constructor code is bellow:


[tt]
/* create session */
QueueConnectionFactory factory = (QueueConnectionFactory)

context.lookup(queueConnectionFactoryJNDIName);
connection = factory.createQueueConnection();
session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);

/* find queues in JNDI */
Queue inQueue = null;
Queue outQueue = null;
if(inQueueJNDIName != null){
inQueue = (Queue) context.lookup(inQueueJNDIName);
}
if(outQueueJNDIName != null){
outQueue = (Queue) context.lookup(outQueueJNDIName);
((MQQueue)outQueue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);
}

/* create sender/receiver/browser */
if(inQueue != null){
receiver = session.createReceiver(inQueue);
browser = session.createBrowser(inQueue);
}
if(outQueue != null){
sender = session.createSender(outQueue);
}

/* start connection */
connection.start();
[/tt]


OK, now the problem: when I deploy the application on the server (WAS 5.1 as written above) the method session.createRecever() (or session.createSender(), when inQueue is null) throws the exception javax.jms.InvalidDestinationException: MQJMS0003: Destination not understood or no longer valid. There are two wierd things about it:
1, When I lookup the same Queue object with another application which uses nearly the same class for working with MQ everything is OK. Therefore I think the Queue should be valid.
2, When I run the application on the test server integrated in WSAD with the same objects defined everything works fine!

Especially the second thing is really wierd - if it runs properly on the test server in WSAD why the hell it fails on the WAS?

The exception stacktrace follows:

[tt]
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R javax.jms.InvalidDestinationException:

MQJMS0003: Destination not understood or no longer valid
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

com.ibm.mq.jms.MQSession.createQReceiver(MQSession.java:5722)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

com.ibm.mq.jms.MQQueueSession.createReceiver(MQQueueSession.java:293)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

com.ibm.mq.jms.MQQueueSession.createReceiver(MQQueueSession.java:272)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

com.ibm.ejs.jms.JMSQueueReceiverHandle.<init>(JMSQueueReceiverHandle.java:84)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

com.ibm.ejs.jms.JMSQueueSessionHandle.createReceiver(JMSQueueSessionHandle.java:144)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

cz.empire.mq4db.componentpart.MQAccessor.<init>(MQAccessor.java:72)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

cz.empire.mq4db.ComponentBase.initComponent(ComponentBase.java:283)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

cz.empire.mq4db.ComponentSynchronized.mainLoop(ComponentSynchronized.java:32)
[10.3.05 14:49:19:180 SE?] 1c3ea0ea SystemErr R at

cz.empire.mq4db.ComponentThread.run(ComponentThread.java:35)
[/tt]

It's my third day I try to solve the problem and it's really frustrating so as I said, if you have any idea please post it. Thanks a lot.

 
Hi,

sedj: thanks for replying, I looked at all of these links, but it didn't help maybe because

I've solved it - and as usual the problem wasn't actually in MQ but it was a classloader issue
 
Hi Ordrabab

even iam facing the same problem
can u let me know the solution
Iam using MQ5.3 with CSD09
thanx in advance
 
Explorer8: I'm not sure whether this can help you. In my case the problem was, that from the previous version of the app which was not runnig on Websphere but only as a standalone java app I had had mq packages (like com.ibm.mq.jar etc.) in my library directory. When I made it web app and deployed on Websphere I had to change the classloader policy to PARENT_LAST (because of the well-known jdom issue). And because I forget the old mq packages in the library directory the classloader used these rather then the ones it should.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top