Author |
Message
|
Dilrukshi |
Posted: Mon Apr 29, 2002 10:02 pm Post subject: |
|
|
Apprentice
Joined: 28 Apr 2002 Posts: 29
|
Hai ,
Iam putting a message from NT to Mainframe MQSeries Queue.The Windows
NT MQSeries version is 5.1 and the Mainframe MQSeries Version is 2.1
.The client is a java program and the server is Mainframe .Through the
programi directly tried to put message into the Queue in MAinframe .
The problem i got was , there are 2 versions in message descriptor ,
the message descriptor of NT has version 2 API's whereas the message descriptor of mainframe has version 1 API's . Because of this conflict the mainframe queue refused to accept the message and it gave an error code 2026.to avoid this i thought of setting the version2 to version 1 through the setVersion() method . But the NT MQSeries version 5.1 didn't allow me to set but the NT MQSeries version 4.0 allowed me to set . Can u please tell me y version 5.1 didn't allow me to change the version of message dscriptor whereas the lower version 4.0
allowed me to change. Or am i wrong in setting the version ?
Thanks in advance
_________________ Dil |
|
Back to top |
|
 |
kolban |
Posted: Tue Apr 30, 2002 5:30 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
I think you are on the right track by using the setVersion() method of the MQMessage class. When you tried to use this, what was the result? Was an error produced? |
|
Back to top |
|
 |
iabarca |
Posted: Tue Apr 30, 2002 11:49 am Post subject: |
|
|
Newbie
Joined: 29 Apr 2002 Posts: 9
|
Hi,
Please can you help me? I work with NT Workstation and AS/400, I need put a message to AS/400, at the NT Workstation you are working with Server o Client, what suggest for this cases.
Thanks in advance.
Quote: |
On 2002-04-29 23:02, Dilrukshi wrote:
Hai ,
Iam putting a message from NT to Mainframe MQSeries Queue.The Windows
NT MQSeries version is 5.1 and the Mainframe MQSeries Version is 2.1
.The client is a java program and the server is Mainframe .Through the
programi directly tried to put message into the Queue in MAinframe .
The problem i got was , there are 2 versions in message descriptor ,
the message descriptor of NT has version 2 API's whereas the message descriptor of mainframe has version 1 API's . Because of this conflict the mainframe queue refused to accept the message and it gave an error code 2026.to avoid this i thought of setting the version2 to version 1 through the setVersion() method . But the NT MQSeries version 5.1 didn't allow me to set but the NT MQSeries version 4.0 allowed me to set . Can u please tell me y version 5.1 didn't allow me to change the version of message dscriptor whereas the lower version 4.0
allowed me to change. Or am i wrong in setting the version ?
Thanks in advance
|
|
|
Back to top |
|
 |
Dilrukshi |
Posted: Tue Apr 30, 2002 10:40 pm Post subject: |
|
|
Apprentice
Joined: 28 Apr 2002 Posts: 29
|
Hai Kolban ,
Thanku for ur reply....
I think iam right in using the setVersion() method . The same code works fine for Version 4.0 APIs . But It gives me the NullpointerException error if version 5.1 API's are used .
Iam enclosing the error
Exception in thread "main" java.lang.NullPointerException
at com.ibm.mq.MQException.<init>(MQException.java:457)
at com.ibm.mq.MQMD.setVersion(MQMD.java:439)
at MQSample2.main(MQSample2.java:47)
Can u please tell me the reason for it .......
Thanks in advance
Friendly
_________________ Dil |
|
Back to top |
|
 |
Dilrukshi |
Posted: Wed May 01, 2002 2:50 am Post subject: |
|
|
Apprentice
Joined: 28 Apr 2002 Posts: 29
|
Hai iabarca
Iam working with Server in the NTWorkstation . Can u be little more clear in ur Q ..
Friendly
_________________ Dil |
|
Back to top |
|
 |
kolban |
Posted: Wed May 01, 2002 5:23 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Can you post the code for your application? |
|
Back to top |
|
 |
Dilrukshi |
Posted: Wed May 01, 2002 6:43 am Post subject: |
|
|
Apprentice
Joined: 28 Apr 2002 Posts: 29
|
Hai Kolban,
This is the code
// This sample runs as an applet using the appletviewer and HTML file,
// using the command :-//
//appletviewer MQSample.html
import com.ibm.mq.*;
import java.io.*;
//import MyReceiveExit;
public class MQSample
{
public void MQSample(){}
public static void main(String[] args)
{
try {
String hostname = "207.221.11.240";
String channel = "SYSTEM.DEF.SVRCONN";
String qManager = "MQA1";
MQQueueManager qMgr;
String s = "";
MQEnvironment.hostname = hostname;
MQEnvironment.port = 1414;
MQEnvironment.channel = channel;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES);
MQEnvironment.properties.put(MQC.USER_ID_PROPERTY,MQEnvironment.userID);
qMgr = new MQQueueManager(qManager);
System.out.println("Connected to the queueManager");
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
MQQueue system_default_local_queue =
qMgr.accessQueue("TESTQUEUE1", openOptions, null, null, null);
MQMessage hello_world = new MQMessage();
hello_world.setVersion(MQC.MQMD_VERSION_1);
s = "Hai ";
hello_world.writeString(s);
MQPutMessageOptions pmo = new MQPutMessageOptions();
hello_world.writeString(s);
system_default_local_queue.put(hello_world,pmo);
System.out.println("The message put is " + s);
System.out.println("PUT message is SUCCESS: ");
system_default_local_queue.close();
qMgr.disconnect();
}
catch (MQException ex)
{
System.out.println("An MQSeries error occurred : Completion code " +
ex.completionCode + " Reason code " + ex.reasonCode);
}
catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer: " + ex);
}
}
}
Thanks for all ur help in advance
_________________ Dil |
|
Back to top |
|
 |
iabarca |
Posted: Wed May 01, 2002 10:09 am Post subject: |
|
|
Newbie
Joined: 29 Apr 2002 Posts: 9
|
Hi Dil,
I am working with NT Workstation like Client and AS/400 like Server, and an app in VB, this app must run at NTWorkstation, I need reset the default parameters to:
Manager : I400MIAMI.RIBS
Request queue : MI.RIBS.REQUEST ( to send their request to )
Reply queue : MI.RIBS.REPLY ( to receive reply from )
Channel name : SERVER.TO.I400MIAMI
for I can work, but I don't know how I do that, Do you have some idea?.
Thanks in advance.
|
|
Back to top |
|
 |
kolban |
Posted: Wed May 01, 2002 10:22 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
|
Back to top |
|
 |
|