|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Error 2026 during segmentation on S/390 |
« View previous topic :: View next topic » |
Author |
Message
|
naylak |
Posted: Wed Mar 03, 2004 4:25 am Post subject: Error 2026 during segmentation on S/390 |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
I am getting Reason code 2026 while performing segmentation on os/390.
After going through this forum I have added the statement setVersion(1).Then I got the following error message.
MQJE001: An MQException occurred: Completion Code 2, Reason 2026
MQJE055: The queue manager does not support version 2 MQSeries API structures
com.ibm.mq.MQException: An MQ Exception occurred: Completion Code 2, Reason 2026
at com.ibm.mq.MQMD.setVersion(MQMD.java:477)
at MQPutSegment.main(MQPutSegment.java:71)
The code is as given below:
import com.ibm.mq.*;
import java.io.*;
public class MQPut
{
public static void main(String args[]) throws Exception
{
System.out.println("MQPutDemo started...");
try
{
MQQueueManager qMgr = new MQQueueManager("CBINBRQM");
String queueName = "CBINGWQ";
MQPutMessageOptions pmo1 = new MQPutMessageOptions();
pmo1.options = pmo1.options|MQC.MQPMO_SET_IDENTITY_CONTEXT | MQC.MQPMO_SYNCPOINT | MQC.MQPMO_LOGICAL_ORDER; ;
int openOptions = MQC.MQOO_OUTPUT | MQC.MQPMO_SET_IDENTITY_CONTEXT ;
MQQueue myQueue = qMgr.accessQueue(queueName ,openOptions,null,null,null);
MQMessage myMessage = new MQMessage();
File f = new File("picture.bmp");
int flength = (int)f.length();
byte[] fileContent = new byte[flength];
FileInputStream fis = new FileInputStream("picture.bmp");
fis.read(fileContent);
int size = 1000000;
byte[] buf = new byte[size];
int start = 0;
int count = 0;
while(flength>size)
{
System.out.println("flength>>>>"+flength);
System.arraycopy(fileContent,start,buf,0,size);
start = start+size;
flength = flength-size;
myMessage.clearMessage();
myMessage.messageFlags = MQC.MQMF_SEGMENT|MQC.MQMF_SEGMENTATION_ALLOWED;
myMessage.write(buf);
myMessage.setVersion(1);
myQueue.put(myMessage, pmo1);
System.out.println("count>>>"+(++count));
}
System.out.println("flength>>>>"+flength);
buf = new byte[flength];
System.arraycopy(fileContent,start,buf,0,flength);
myMessage.clearMessage();
myMessage.messageFlags = MQC.MQMF_LAST_SEGMENT | MQC.MQMF_SEGMENTATION_ALLOWED;
myMessage.write(buf);
myMessage.setVersion(1);
myQueue.put(myMessage, pmo1);
System.out.println("count>>>"+(++count));
myQueue.close();
qMgr.commit();
qMgr.disconnect();
System.out.println("MQPut Demo completed");
}catch(MQException mqEx)
{
mqEx.printStackTrace();
}
catch(IOException ioe)
{
ioe.printStackTrace();
}
}
}
Please help me in resolving the problem
Thanks in advance
with regards
naylak |
|
Back to top |
|
 |
EddieA |
Posted: Wed Mar 03, 2004 6:12 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Now you are doing it the oposite way to your previous question: http://www.mqseries.net/phpBB2/viewtopic.php?t=13784&highlight=
Read the answer to that one. You either segment the message in you code, and set the appropriate flags, OR, you put a single message with Segmention allowed.
I'd suggest reading the APG to get a better understanding of Segmentation.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
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
|
|
|
|