Author |
Message
|
ping master |
Posted: Thu Feb 27, 2003 11:46 am Post subject: Java PCF question using the MSOB pcf files |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
Anyone know what the error for this is I am obviously running the ListQManagerAttrs program that came with the MSOB pcf classes from IBM support pac. on mq 5.3 /XP ---I'm thinking it means codepages 437??????? what is that???
C:\javasrc>java ListQManagerAttrs
Usage:
java ListQManagerAttrs queue-manager
java ListQManagerAttrs host port channel
C:\javasrc>java ListQManagerAttrs QUEUEMGR1
Connecting to local queue manager QUEUEMGR1... Connected.
Sending PCF request... Received reply.
Queue manager attributes:
java.io.UnsupportedEncodingException: Cp437 |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Feb 27, 2003 11:59 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well MQSeries Server version 5.3 on XP, I dont believe that IBM is supporting it at this point, I could be wrong. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
ping master |
Posted: Thu Feb 27, 2003 12:13 pm Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
Yes IBM is supporting it XP MQ 5.3 and has released the production version,
I believe this has to do with my JRE/SDK...
1.3.1_01JRE
1.4.1_01SDK(noJRE installed)
anyone..
Bueller...
anyone... |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Feb 27, 2003 12:24 pm Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well then that said, the issue is codepage, it appears that one of the fields in your PCF Message field isnt encoded correctly, IE maybe a numeric field contains data or vice versa. If you post your code it might help. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
kolban |
Posted: Thu Feb 27, 2003 9:38 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
|
Back to top |
|
 |
ping master |
Posted: Fri Feb 28, 2003 6:52 am Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
Thanks guys, I added i18n.jar to my Classpath and this is now what I am getting..
C:\javasrc>java ListQueueNames QueueMgr1
Connecting to local queue manager QueueMgr1... Connected.
Sending PCF request... Received reply.
Queue names:
Exception in thread "main" java.lang.NoSuchFieldError: byteToCharTable
at sun.io.ByteToCharCp437.<init>(ByteToCharCp437.java:31)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at sun.io.Converters.newConverter(Unknown Source)
at sun.io.Converters.newConverter(Unknown Source)
at sun.io.ByteToCharConverter.getConverter(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at com.ibm.mq.MQMessage.readConvertedString(MQMessage.java:958)
at com.ibm.mq.MQMessage.readString(MQMessage.java:877)
at com.ibm.mq.pcf.MQCFSL.initialize(MQCFSL.java:222)
at com.ibm.mq.pcf.MQCFSL.<init>(MQCFSL.java:159)
at ListQueueNames.main(ListQueueNames.java:61)
Here is the code from IBM:
Code: |
import java.io.*;
import com.ibm.mq.*;
import com.ibm.mq.pcf.*;
/**
* PCF example class showing use of PCFAgent and com.ibm.mq.pcf structure types
* to generate and parse a PCF query. Note that the list of queue names returned
* includes the dynamic queue used by the PCFAgent; the name of this queue is
* accessible as the replyQueueName field of the PCFAgent object.
*
* @author Chris Markes
*/
public class ListQueueNames
{
final public static String copyright = "Copyright (c) IBM Corp. 1998 All rights reserved.";
public static void main (String [] args)
{
PCFAgent agent;
PCFParameter [] parameters =
{
new MQCFST (CMQC.MQCA_Q_NAME, "*"),
new MQCFIN (CMQC.MQIA_Q_TYPE, CMQC.MQQT_ALL)
};
MQMessage [] responses;
MQCFH cfh;
MQCFSL cfsl;
try
{
// Connect a PCFAgent to the specified queue manager
if (args.length == 1)
{
System.out.print ("Connecting to local queue manager " +
args [0] + "... ");
agent = new PCFAgent (args [0]);
}
else
{
System.out.print ("Connecting to queue manager at " +
args [0] + ":" + args [1] + " over channel " + args [2] + "... ");
agent = new PCFAgent (args [0], Integer.parseInt (args [1]), args [2]);
}
System.out.println ("Connected.");
// Use the agent to send the request
System.out.print ("Sending PCF request... ");
responses = agent.send (CMQCFC.MQCMD_INQUIRE_Q_NAMES, parameters);
System.out.println ("Received reply.");
cfh = new MQCFH (responses [0]);
// Check the PCF header (MQCFH) in the first response message
if (cfh.reason == 0)
{
System.out.println ("Queue names:");
cfsl = new MQCFSL (responses [0]);
for (int i = 0; i < cfsl.strings.length; i++)
{
System.out.println ("\t" + cfsl.strings [i]);
}
}
else
{
System.out.println (cfh);
// Walk through the returned parameters describing the error
for (int i = 0; i < cfh.parameterCount; i++)
{
System.out.println (PCFParameter.nextParameter (responses [0]));
}
}
// Disconnect
System.out.print ("Disconnecting... ");
agent.disconnect ();
System.out.println ("Done.");
}
catch (ArrayIndexOutOfBoundsException abe)
{
System.out.println ("Usage: \n" +
"\tjava ListQueueNames queue-manager\n" +
"\tjava ListQueueNames host port channel");
}
catch (NumberFormatException nfe)
{
System.out.println ("Invalid port: " + args [1]);
System.out.println ("Usage: \n" +
"\tjava ListQueueNames queue-manager\n" +
"\tjava ListQueueNames host port channel");
}
catch (MQException mqe)
{
System.err.println (mqe);
}
catch (IOException ioe)
{
System.err.println (ioe);
}
}
}
|
|
|
Back to top |
|
 |
kolban |
Posted: Fri Feb 28, 2003 9:44 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Looking on the Usenet, it appears that this problem is most likely caused by having two sets of systems classes in your CLASSPATH, one belonging to one JVM version and the other to another. So you might be picking up i18n.jar from one implementation and other JVM classes from another JVM instance. |
|
Back to top |
|
 |
ping master |
Posted: Mon Mar 03, 2003 6:34 am Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
Kolban, you are good man.
that's what it was, thanks. Now if I can get a handle on this Administration MQ programming I'll be alright. I would like to write it in javascript from a web page, but I may have to go with Java instead as a standalone.
PM |
|
Back to top |
|
 |
|