|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQJE001: Completion Code 2, Reason 2010 |
« View previous topic :: View next topic » |
Author |
Message
|
anandloni |
Posted: Thu Jun 10, 2010 4:57 am Post subject: MQJE001: Completion Code 2, Reason 2010 |
|
|
Newbie
Joined: 10 Jun 2010 Posts: 3
|
Any idea's about this error code ? |
|
Back to top |
|
 |
anandloni |
Posted: Thu Jun 10, 2010 5:01 am Post subject: |
|
|
Newbie
Joined: 10 Jun 2010 Posts: 3
|
Hello,
I am trying to put message of size 2 MB using MQ API. I am getting below exception:
Code: |
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2010
|
Here are my queue manager and queue properties:
Code: |
qm : com.ibm.mq.MQQueueManager@22982298
Command level: 600
MaximumMessageLength: 4194304
MaximumPriority: 9
SyncpointAvailability: 1
CCDTURL: null
DistributionListCapable: true
SupportsQAT2: false
Connected: true
Is open: true
Queue: com.ibm.mq.MQQueue@35e235e2
Current depth: 10
Max depth: 5000
Max msg length: 4194304
Inhibit get: 0
Inhibit put: 0
Open Input Count: 0
Open Output count: 0
Queue type: 1
Sharability: 1
Trigger Control: 0
Trigger Depth: 1
Trigger Data:
Trigger Type: 1
ConnectionCCSID: 437
Defination type: 1
|
And my code is as below:
Code: |
MQEnvironment.hostname = "localhost"; // host to connect to
MQEnvironment.port = 1414;
MQEnvironment.CCSID = 437;
MQEnvironment.channel = "SYSTEM.DEF.SVRCONN";
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES_CLIENT);
MQQueueManager qm = new MQQueueManager(queue.getMQ_QMGR_NAME());
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE;
logger.debug("qm : " + qm);
if (qm != null)
{
logger.debug("Command level: " + qm.getCommandLevel());
logger.debug("MaximumMessageLength: "
+ qm.getMaximumMessageLength());
logger.debug("MaximumPriority: " + qm.getMaximumPriority());
logger.debug("SyncpointAvailability: "
+ qm.getSyncpointAvailability());
logger.debug("CCDTURL: " + qm.getCCDTURL());
logger.debug("DistributionListCapable: "
+ qm.getDistributionListCapable());
logger.debug("SupportsQAT2: " + qm.getSupportsQAT2());
logger.debug("Connected: " + qm.isConnected());
logger.debug("Is open: " + qm.isOpen());
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_NONE;
MQQueue q = qm.accessQueue(queue.getMQ_QUEUE_NAME(),
openOptions, null, null, null);
logger.debug("Queue: " + q);
logger.debug("Current depth: " + q.getCurrentDepth());
logger.debug("Max depth: " + q.getMaximumDepth());
logger.debug("Max msg length: "
+ q.getMaximumMessageLength());
logger.debug("Inhibit get: " + q.getInhibitGet());
logger.debug("Inhibit put: " + q.getInhibitPut());
logger.debug("Open Input Count: " + q.getOpenInputCount());
logger
.debug("Open Output count: "
+ q.getOpenOutputCount());
logger.debug("Queue type: " + q.getQueueType());
logger.debug("Sharability: " + q.getShareability());
logger.debug("Trigger Control: " + q.getTriggerControl());
logger.debug("Trigger Depth: " + q.getTriggerDepth());
logger.debug("Trigger Data: " + q.getTriggerData());
logger.debug("Trigger Type: " + q.getTriggerType());
logger.debug("ConnectionCCSID: " + q._getConnectionCCSID());
logger.debug("Defination type: " + q.getDefinitionType());
logger.debug("data length: " + message.getDataLength());
logger.debug("message length: " + message.getMessageLength());
logger.debug("Total message length: " + message.getTotalMessageLength());
//message.format = "MQSTR";
//message.messageFlags = MQC.MQMF_SEGMENTATION_ALLOWED;
q.put(message,pmo);
q.close();
qm.disconnect();
}
|
Any idea how to solve this issues ? |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Jun 10, 2010 5:32 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
2010 is "invalid data length"
i am no java guru, but i do not find the code line where you set the message content _________________ Regards, Butcher |
|
Back to top |
|
 |
anandloni |
Posted: Thu Jun 10, 2010 5:46 am Post subject: |
|
|
Newbie
Joined: 10 Jun 2010 Posts: 3
|
Here is the message details:
Code: |
MQMessage message = new MQMessage();
message.messageId = <someId>.getBytes();
message.correlationId = <someId>.getBytes();
//read pdf here
ByteArrayOutputStream baos = (ByteArrayOutputStream)dqm.getPm().getPrintDocument();
//File pd = (File) dqm.getPm().getPrintDocument();
//String name = pd.getAbsolutePath();
InputStream in;
ByteArrayInputStream bin = new ByteArrayInputStream(baos.toByteArray());
//bm.writeBytes(baos.toByteArray());
try {
//in = new FileInputStream(name);
//bm.writeBytes(baos.toByteArray());
BufferedInputStream inBuf = new BufferedInputStream(bin);
int i;
while ((i = inBuf.read()) != -1) {
message.writeInt(i);
}
// adding an eof
message.writeInt(-1);
} catch (IOException e) {
// TODO Auto-generated catch block
log.error("IOException in createMessage ",e);
}
|
|
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Jun 10, 2010 6:39 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
again, i am not a java guru..... your program dies with 2010 during the output of message.getdatalength. the manual reads for getdatalength "Gets the number of bytes of message data remaining to be read."
you are not reading messages, you are putting. i would just remove that debug line and try again.
btw.. that getTotalMessageLength looks suspicious too and may be the next reason for a failure.... as this also applies to messages being get. _________________ Regards, Butcher |
|
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
|
|
|
|