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 Index » IBM MQ Java / JMS » Error 2026 during segmentation on S/390

Post new topic  Reply to topic
 Error 2026 during segmentation on S/390 « View previous topic :: View next topic » 
Author Message
naylak
PostPosted: Wed Mar 03, 2004 4:25 am    Post subject: Error 2026 during segmentation on S/390 Reply with quote

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
View user's profile Send private message
EddieA
PostPosted: Wed Mar 03, 2004 6:12 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Error 2026 during segmentation on S/390
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.