Author |
Message
|
mmistroni |
Posted: Wed Jan 09, 2008 8:29 am Post subject: The return code from the TCP/IP (read) call was 73 (X'49') |
|
|
Novice
Joined: 09 Jan 2008 Posts: 12
|
Hello all,
i have a Spring webapp that connects to an MQ.
In my JUnit test i am sending messages to a Queue and try to read from them.
Currently, messages are HUGE xml files, and everything works fine.
Yesterday, by chance, i tried to send a small message (the string "foobar") and suddenly i got a huge disaster exception.
Here's what Spring logs say
Code: |
rg.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
Caused by: javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
at com.ibm.mq.jms.MQMessageProducer.sendInternal(MQMessageProducer.java:1589)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1012)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1046)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:537)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:513)
at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:489)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:430)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:486)
at server.mqseries.MQListenerTest.contact admin(MQListenerTest.java:105)
|
As i was unable to find out problem i asked MQ Admin to send me logs..
he told me that this was in the logs
Code: |
The return code from the TCP/IP (read) call was 73 (X'49'). Record these values
and tell the systems administrator.
|
I have absolutely no idea why a huge message does not fail, and a 6 chars string causes a big exception...
anyone could provide some help here? i didnt found any answers by googling it...
regards
marco |
|
Back to top |
|
 |
tleichen |
Posted: Wed Jan 09, 2008 9:08 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
I'm not a JMS programmer, but the MQ error 2009 makes this look like either you haven't made a successful connection and/or open call. Either because it has not been coded, or your environmental setup is not such that this will function.
Without more data, I cannot theorize any further. I'm assuming that you do know how to write a JMS MQ application.  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jan 09, 2008 9:23 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you can really show that
1) sending a big file
2) immediately followed, using the same connection, same code, and etc., by sending a very small message
causes the second put/send to get the 2009...
Then likely you have a network configuration issue. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Jan 09, 2008 9:34 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Or some peice of easter egg code created by a creative developer somewhere reacts to the string "foobar".
Try sending various small messages to see if the problem is reproducable.
My guess is you lost the connection for some other reason coincidentally at the same time you put that foobar message. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
mmistroni |
Posted: Thu Jan 10, 2008 1:32 am Post subject: |
|
|
Novice
Joined: 09 Jan 2008 Posts: 12
|
Hello,
well, i can reproduce the problem any time i want. I just have to send a random string instead of a huge XML file.
I am just curious of why exactly the same code works with a huge XML file while it fails with a small string./
If it's a connection problem, do i have to assume that with XML the connection does not drop because there's a huge message to read?
because that is the only explanation that comes to my mind (bearing in mind i don't know how MQ works internally)...
i'll try to grab a sample code, run it and see what happens, then i'll come back here
thanks for all replies
marco |
|
Back to top |
|
 |
mmistroni |
Posted: Thu Jan 10, 2008 2:36 am Post subject: |
|
|
Novice
Joined: 09 Jan 2008 Posts: 12
|
Hello,
ok i got some code (not working to show
I have modified the existing code i have by followign an example from IBM.. just to see if i can get something working....
First of all, let me clarify that i am NOT connecting to an MQ running on a WAS server. rather, is an MQ standalone installation. (it's MQServer 6.02 running on AIX)
here's code i am trying for testing mq (copied from ibm website)_
Code: |
MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
// Config
cf.setHostName(MyHost);
cf.setPort(1419);
cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
cf.setQueueManager(QueueMgr);
cf.setChannel(Channel);
cf.setUseConnectionPooling(true);
MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();
MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
MQQueue queue = (MQQueue) session.createQueue("CTEST");
MQQueueSender sender = (MQQueueSender) session.createSender(queue);
MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue);
long uniqueNumber = System.currentTimeMillis() % 1000;
JMSTextMessage message = (JMSTextMessage) session.createTextMessage("SimplePTP " + uniqueNumber);
// Start the connection
connection.start();
sender.send(message);
System.out.println("Sent message:\\n" + message);
JMSMessage receivedMessage = (JMSMessage) receiver.receive(10000);
System.out.println("\\nReceived message:\\n" + receivedMessage);
sender.close();
receiver.close();
session.close();
connection.close();
System.out.println("\\nSUCCESS\\n");
}
catch (JMSException jmsex) {
System.out.println(jmsex);
System.out.println("\\nFAILURE\\n");
jmsex.printStackTrace();
fail("failed..");
}
catch (Exception ex) {
System.out.println(ex);
System.out.println("\\nFAILURE\\n");
ex.printStackTrace();
fail("-- failed big time..");
}
|
and here's exception i am getting....
Code: |
javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
at com.ibm.mq.jms.MQMessageProducer.sendInternal(MQMessageProducer.java:1589)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1012)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1046)
at com.bnpparibas.risk.collateralrisk.server.mqseries.MQListenerTest.testSendingMessageToAMQ(MQListenerTest.java:279)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
|
|
|
Back to top |
|
 |
mmistroni |
Posted: Thu Jan 10, 2008 3:04 am Post subject: |
|
|
Novice
Joined: 09 Jan 2008 Posts: 12
|
Hello..
More trial... more failures
I was asked early, to do a send of ab ig xml file followed by a test string..
Here's code i have tried
Code: |
String destinationName = "TEST";
MQConnectionFactory mqFactory = new MQConnectionFactory();
mqFactory.setHostName(MYOST);
mqFactory.setPort(1419);
mqFactory.setChannel(MYCHANNEL);
mqFactory.setQueueManager(MYQUEUEMGR);
mqFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
mqFactory.setUseConnectionPooling(true);
JmsTemplate jmsTemplate = new JmsTemplate(mqFactory);
final String template = FieldParsingTestHelper.loadTextResource("exampleMessagePhase2TestData.xml", this.getClass());
jmsTemplate.send(destinationName, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
TextMessage textMessage = session.createTextMessage(template);
return textMessage;
}
});
jmsTemplate.send(destinationName, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
TextMessage textMessage = session.createTextMessage("foobar messsage...");
return textMessage;
}
});
|
and this again results in
Code: |
2008.01.10 10:44:35 MQJMS1016E an internal error has occurred. Please contact your system administrator. Detail: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
Caused by: javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
at com.ibm.mq.jms.MQMessageProducer.sendInternal(MQMessageProducer.java:1589)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1012)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1046)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:537)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:513)
at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:489)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:430)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:486)
at mqseries.MQListenerTest.testAMessageListenerContainer(MQListenerTest.java:252)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
|
Jefflowrey asked this..
Quote: |
If you can really show that
1) sending a big file
2) immediately followed, using the same connection, same code, and etc., by sending a very small message
causes the second put/send to get the 2009...
Then likely you have a network configuration issue.
|
the code above does that... well now question is: what kind of network configuration issue?
Coz, if i switch and send first the small string and then the big xml, the first fail (again) but hte big xml works just fine........
this is all a big mistery...... but somehow i hav to get to the bottom of this issue......
any help?
regards
marco
[/quote] |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 10, 2008 4:37 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
See if sending a message that is still plain text, but larger than 1024K, causes the same problem.
If you find some power of 2 that is a marker between the messages that work and the ones that don't, then it's an issue with the network packet size handling. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 10, 2008 8:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
As well when you get a JMSException always extract the LinkedException and display it as it contains the provider specific information.
Be aware however that the LinkedException may be null. _________________ MQ & Broker admin |
|
Back to top |
|
 |
bbburson |
Posted: Thu Jan 10, 2008 8:06 am Post subject: |
|
|
Partisan
Joined: 06 Jan 2004 Posts: 378 Location: Nowhere near a queue manager
|
Your output above shows a 2019 return code BEFORE the 2009. 2019 is MQRC_HOBJ_ERROR. Sounds like you're using a stale handle. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 10, 2008 11:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bbburson wrote: |
Your output above shows a 2019 return code BEFORE the 2009. 2019 is MQRC_HOBJ_ERROR. Sounds like you're using a stale handle. |
Stale or out of MQ Scope handle... _________________ MQ & Broker admin |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 10, 2008 11:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks more and more like a JMS problem to me:
To be clear the order is
- qcf /tcf
- connection -- a connection can be started, stopped and closed. A closed connection is automatically out of scope, supposed to have closed all its dependent objects and only fit to be garbage collected as it has released any physical or logical resources ...
- session -- In JMS this is a very important object as this is where you set transactionality and UOW boundaries...
Remember some appserver like WebSphere WAS override any transactionlity settings on the sessiom
- consumer producer
- reverse order to close...
_________________ MQ & Broker admin |
|
Back to top |
|
 |
mmistroni |
Posted: Fri Jan 11, 2008 2:30 am Post subject: |
|
|
Novice
Joined: 09 Jan 2008 Posts: 12
|
fjb_saper,
i take ur point./
But what's the explanation of why if i send a huge text message (XML or not) it just work, while if i send a string it doesn't?
and this is not matter hte order.. if i send string first, string fail while huge text work.
if i send huge text first and then the string, huge text will succeed while small string will fail
and all using hte same code....
this is what puzzles me...
thanks for comments, i'll investigate further and post back
regards
marco |
|
Back to top |
|
 |
mmistroni |
Posted: Fri Jan 11, 2008 2:42 am Post subject: |
|
|
Novice
Joined: 09 Jan 2008 Posts: 12
|
Hi ,
got the LinkexException
Code: |
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
at com.ibm.mq.MQQueue.putMsg2(MQQueue.java:1498)
at com.ibm.mq.jms.MQMessageProducer.sendInternal(MQMessageProducer.java:1569)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1012)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1046)
at com.mqseries.MQListenerTest.testSendingMessageToAMQ(MQListenerTest.java:242)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
|
does this bring me little closer to real problem?
thanks and regards
marco |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 11, 2008 4:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Reason Code 2009 is a well known reason code. Search the forum with it...
Looks you could have a network / connectivity problem...
In basic MQ speak... your MQ connection is no longer valid. You need to acquire a new one... _________________ MQ & Broker admin |
|
Back to top |
|
 |
|