|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQJMS1017 when creating temporary q on qsg on z/OS |
« View previous topic :: View next topic » |
Author |
Message
|
hwv |
Posted: Mon Oct 06, 2008 9:08 am Post subject: MQJMS1017 when creating temporary q on qsg on z/OS |
|
|
Novice
Joined: 03 Jun 2005 Posts: 19
|
Hi,
I want to use a temporary queue as reply2q when putting a request to a QSG on z/OS. But when I try to get the message from the replyQ, I get an error:
Code: |
javax.jms.TemporaryQueue replyQueue = session.createTemporaryQueue();
...
javax.jms.Message respMessage = session.createReceiver(replyQueue, selector).receive(60000);
|
throws a MQJMS1017 if connected to a QSG on z/OS:
JMS error: MQJMS1017: Nicht-lokale MQ-Warteschlange für Empfang bzw. Anzeige nicht zulässig
I've found PQ98748 but this is for 5.3 and we are using 6
Anybody knows if this is a bug?
Many thanks
hwv |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Oct 06, 2008 10:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Translation for the Germanophobic:
JMS error: MQJMS1017: Nicht-lokale MQ-Warteschlange für Empfang bzw. Anzeige nicht zulässig :
Ist doch Klar oder?
JMS error: MQJMS1017: Non local MQ queue for receive or display not authorized.
Are you sure you have all the permissions? You need to add inq to all JMS persmissions...
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
hwv |
Posted: Tue Oct 07, 2008 1:21 am Post subject: |
|
|
Novice
Joined: 03 Jun 2005 Posts: 19
|
fjb_saper wrote: |
Are you sure you have all the permissions? You need to add inq to all JMS persmissions...
 |
Yes, the permissions are ok.
I have found a workaround:
When using a temporary replyQ and a QSG I have to create two sessions.
When using a permanent replyQ and a QSG creating one session is sufficient.
When using a temporary replyQ and a single Queumanager creating one session is sufficient.
When using a permanent replyQ and a single Queuemanager creating one session is sufficient.
A quote from WebSphere MQUsing Java Version 6.0:
Quote: |
A JMS session is a single-threaded context for producing and consuming messages. |
hwv |
|
Back to top |
|
 |
hwv |
Posted: Tue Oct 07, 2008 3:51 am Post subject: |
|
|
Novice
Joined: 03 Jun 2005 Posts: 19
|
Even more weird:
I have created two sessions. But I don't use the second one, both Qs are created by the first Session . Still working. Is there any explanation?
Here 's the code:
Code: |
package de.amb.mq.jms.tests;
import java.util.Date;
import javax.jms.Destination;
public class ReqRepl
{
/**
* @param args
*/
// private String MANAGER="MQXT1";
// private String HOSTNAME="aixtest";
// private int PORT=1414;
// private String CHANNEL="MQXT1.SVRCONN.HW";
// private String REQUEST_QUEUE_NAME="TEST.QUEUE.HWV.DATA";
private String MANAGER="QSGT";
// private String MANAGER=" ";
private String HOSTNAME="12.345.67.89";
private int PORT=1421;
private String CHANNEL="CF.SVRCONN.WK";
private String REQUEST_QUEUE_NAME="TEST.QUEUE.HWV.DATA.CFS";
private String message="Request vom ";
public static void main(String[] args)
{
new ReqRepl().runTheTest();
}
public void runTheTest()
{
javax.jms.QueueConnection connection = null;
javax.jms.QueueSession session = null;
javax.jms.QueueSession session2 = null;
javax.jms.QueueSender queueSender = null;
javax.jms.QueueReceiver queueReceiver = null;
try {
//
com.ibm.mq.jms.MQQueueConnectionFactory factory = new com.ibm.mq.jms.MQQueueConnectionFactory();
factory.setTransportType(com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
factory.setQueueManager(MANAGER);
factory.setHostName(HOSTNAME);
factory.setPort(PORT);
factory.setChannel(CHANNEL);
// factory.setTemporaryModel("SYSTEM.DEFAULT.MODEL.QUEUE.QSG");
//
System.out.println("Factory-Version: " + factory.getVersion());
connection = factory.createQueueConnection();
connection.start();
//
session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
session2 = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); //
javax.jms.Queue reqQueue = session.createQueue(REQUEST_QUEUE_NAME);
javax.jms.TemporaryQueue respQueue = session.createTemporaryQueue();
//
System.out.println("Creating a TextMessage");
javax.jms.TextMessage reqMessage = session.createTextMessage();
reqMessage.setJMSReplyTo((Destination) respQueue);
reqMessage.setText( message + new Date().toLocaleString() );
//
session.createSender(reqQueue).send(reqMessage);
String selector = "JMSCorrelationID = '" + reqMessage.getJMSMessageID() + "'";
javax.jms.Message replyMessage = session.createReceiver(respQueue, selector).receive(60000);
// javax.jms.Message respMessage = session.createReceiver(respQueue).receive(60000);
//
if (replyMessage != null) {
if (replyMessage instanceof javax.jms.TextMessage) {
String replyString = ((javax.jms.TextMessage) replyMessage).getText();
System.out.println(replyString);
}
else {
System.out.println("Reply message was not a TextMessage");
}
}
else {
System.out.println("No Message Found");
}
}
catch (javax.jms.JMSException e) {
e.printStackTrace();
Exception exx = e.getLinkedException() != null ? e.getLinkedException() : e;
String msg = "JMS error: "+exx.getMessage();
System.err.println("M1: " + msg);
System.err.println("M2: " + e.getErrorCode());
// System.err.println("caught " + je);
// Exception e = je.getLinkedException();
// if (e != null) {
// System.err.println("linked exception:" + e);
// }
}
finally {
System.out.println("Cleaning up");
try {connection.close();} catch (Exception e) {}
try {session.close();} catch (Exception e) {}
try {queueSender.close();} catch (Exception e) {}
try {queueReceiver.close();} catch (Exception e) {}
}
}
} |
I only have to comment this line out to get the MQJMS1017:
Quote: |
// session2 = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); |
hwv  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|