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 IndexIBM MQ Java / JMSHelp!!! (MQJMS1058: not valid message property name )

Post new topicReply to topic
Help!!! (MQJMS1058: not valid message property name ) View previous topic :: View next topic
Author Message
mqwf1
PostPosted: Sat Jan 19, 2002 6:08 am Post subject: Reply with quote

Novice

Joined: 13 Jan 2002
Posts: 22

source :
=============================================
import javax.jms.*; /* import of Sun's JMS interface */


/* Imports for MQSeries specific objects */
import com.ibm.mq.MQC;
import com.ibm.mq.jms.MQQueue;

import com.ibm.mq.jms.MQQueueConnectionFactory; /* import to allow program */
/* to bypass JNDI lookup */

public class mqjmsro {

public static String QMGR = "FMCQM";
public static final String QUEUE = "REPLYQ" ;

public static void main( String[] args )
{
String outString = "Test message from mqjmsro";
Queue ioQueue = null;
QueueSession session = null;
QueueConnection connection = null;
QueueConnectionFactory factory = null;

System.out.println("mqjmsro sample program");

/********************************************************/
/* Process command-line arguments looking for qmgr name */
/********************************************************/
for ( int i=0; i<args.length; i++ ) {
String arg = args[i].toLowerCase();

if( arg.equals("-m") ) {
if (i+1< args.length) {
QMGR = args[++i];
} else {
System.out.println("Ignoring -m flag; no value supplied");
}
} else
// Report and discard any unknown command-line options
System.out.println("Ignoring unknown flag: " + arg );
}

try {

/****************************************************/
/* Create the connection factory directly from qmgr */
/****************************************************/
System.out.println(" creating QueueConnectionFactory");
factory = new MQQueueConnectionFactory();
((MQQueueConnectionFactory)factory).setQueueManager(QMGR);

/****************************************************/
/* Create the connection. Note: Receive calls will */
/* be blocked if the connection is not explicityly */
/* started. */
/****************************************************/
System.out.println(" creating connection");
connection = factory.createQueueConnection();
System.out.println(" starting connection");
connection.start();

/**************************************************/
/* Create a session that won't be transacted and */
/* that should automatically acknowledge received */
/* messages. */
/**************************************************/
System.out.println(" creating session");
boolean transacted = false;
session = connection.createQueueSession( transacted,
Session.AUTO_ACKNOWLEDGE);

/**********************************************/
/* Create a queue using the MQSeries specific */
/* queue name. */
/**********************************************/
ioQueue = session.createQueue( QUEUE );

/**********************************************/
/* Use the session to create a QueueSender by */
/* passing in the destination parameter. */
/**********************************************/
System.out.println(" creating a QueueSender");
QueueSender queueSender = session.createSender(ioQueue);

/***************************************************/
/* Create an empty message and put our text in it. */
/***************************************************/
System.out.println( " creating the message" );
TextMessage outMessage = session.createTextMessage();
outMessage.setText(outString);

/******************************************************/
/* In order to get a report exception, MQSeries must */
/* be given a destination for it. The following code */
/* will set the destination to be the queue manager */
/* and queue where the message is being sent. This */
/* would normally not be done but is being done here */
/* for convenience. */
/******************************************************/
MQQueue replyToQ = new MQQueue(QMGR,QUEUE);
Destination replyTo = (Destination) replyToQ;
outMessage.setJMSReplyTo(replyTo);

System.out.println(" setting Report property");
outMessage.setIntProperty("JMS_IBM_Report_Exception",
MQC.MQRO_EXCEPTION_WITH_DATA);
//should be put in MQMD header!!!
//outMessage.setStringProperty("JMSXUserID","1"); //exception jms1058
outMessage.setStringProperty("JMSXAppID","lad");
//info below will put in MQRFH2 header
outMessage.setStringProperty("JMSXGroupID","FMCGRP"); //JMSXUserID


outMessage.setStringProperty("x2D","1");

/*********************************/
/* Send the message to the queue */
/*********************************/
System.out.println( " sending message to " + ioQueue.getQueueName() );
queueSender.send(outMessage);

/***********************************/
/* Program is done, close objects. */
/***********************************/
System.out.println(" closing queue");
queueSender.close();

System.out.println(" closing session");
session.close();
session = null;

System.out.println(" closing connection");
connection.close();
connection = null;

} catch( JMSException je ) {
System.out.println("Caught JMSException: " + je);
Exception le = je.getLinkedException();
if (le != null) System.out.println("linked exception: " + le);

} catch( Exception e ) {
System.out.println("Caught exception: " + e );

} finally {
/*****************************************************/
/* We'll use a finally block to ensure that the most */
/* important JMS objects were closed. */
/*****************************************************/
try {
if (session != null) {
System.out.println(" closing session");
session.close();
}
if (connection != null) {
System.out.println(" closing connection");
connection.close();
}
} catch (JMSException je) {
System.out.println("Caught exception: "+je);
}
}

System.out.println("mqjmsro ending...");
}


}

=============================================
run infomation:

D:eccmqjmsro.java.tar>java mqjmsro
mqjmsro sample program
creating QueueConnectionFactory
creating connection
starting connection
creating session
creating a QueueSender
creating the message
setting Report property
Caught JMSException: javax.jms.MessageFormatException: MQJMS1058: not valid message property name JMSXAppID
closing session
closing connection
mqjmsro ending...
Back to top
View user's profile Send private message
kolban
PostPosted: Sat Jan 19, 2002 11:05 am Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

See topic http://www.mqseries.net/phpBB/viewtopic.php?topic=616&forum=12

[ This Message was edited by: kolban on 2002-01-19 11:07 ]
Back to top
View user's profile Send private message
mqwf1
PostPosted: Sat Jan 19, 2002 8:37 pm Post subject: Reply with quote

Novice

Joined: 13 Jan 2002
Posts: 22

Thanks kolban.
I modify my source and try it .An exception was throw:
javax.jms.JMSException: MQJMS1011:
cannot indicate security credentials while using MQ binding

(it was translated English Message(sorry,not exactly)
original Chineses message is :
ʹÓà MQ °ó¶¨Ê±²»ÄÜÖ¸¶¨°²È«ÐÔƾ֤
)
Pls tell me what is the problem?
Thanks.


Back to top
View user's profile Send private message
kolban
PostPosted: Sun Jan 20, 2002 6:35 pm Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

What does your source look like now? What line is throwing the exception? What is the underlying MQ linked error (if any)?
Back to top
View user's profile Send private message
mqwf1
PostPosted: Mon Jan 21, 2002 1:11 am Post subject: Reply with quote

Novice

Joined: 13 Jan 2002
Posts: 22

old source:
connection = factory.createQueueConnection();
changed source:
connection = factory.createQueueConnection("PM1","PM1");//userid,password
Exception Throws when execute this changed line and
Linked Exception is null.

Thanks.
Back to top
View user's profile Send private message
kolban
PostPosted: Mon Jan 21, 2002 6:09 am Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

IBM's JMS is layered/built on top of MQSeries. An MQSeries application can connect to the queue manager in one of two ways. It can be a "client" which means that it forms a network connection and supplies a userid or else it can be "server bound" which means it uses Inter Process Communication and must exist on the same box as the queue manager. In this case, no userid is supplied as authentication is taken from the userid that the application is running as.

Your JMS application is configured to connect to a local queue manager using server binding. In this case, when you attempted to set the userid that the JMS Client should appear to the queue manager as, it was rejected as an invalid operation.

Options:
o Don't set userid
o Connect to queue manager as client
Back to top
View user's profile Send private message
mqwf1
PostPosted: Mon Jan 21, 2002 7:13 am Post subject: Reply with quote

Novice

Joined: 13 Jan 2002
Posts: 22

I'm not sure I catch your words. I repeat it in my words below :
If my JMS app and request Queue in the same machine then I can't set userid;
Only if JMS app send message to remote queue JMS app can set userid.

Another relativa question:
What do I do to tell JMS that I want to run as client of remote MQ QM?
JMS API or Queue definition?
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSHelp!!! (MQJMS1058: not valid message property name )
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.