You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Richa Khurana <ri...@globallogic.com> on 2008/12/03 10:26:07 UTC

javax.jms.JMSException: Wire format negociation timeout: peer did not send his wire format on SMX console

Hi,

 

I have a simple application to send mails asynchronously. This is what I
do-

 

1.	I have a simple JMS client which sends email as an XML Payload
to SMX JMS. I am direcly accessing it with tcp protocol.
2.	The messages are received by JMS server on SMX side.
3.	These messages are routed to my XBean, which in turn uses camel
mail component to send the mails.

 

Although email functionality works fine, very often I get this error
message on SMX console and all the components stop working. On restart
of SMX, everything starts working again.

 

 

Here is the exception-

javax.jms.JMSException: Wire format negociation timeout: peer did not
send his wire format.
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
java:58)
        at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection
.java:1185)
        at
org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQ
Connection.java:1263)
        at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.
java:276)
        at
org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.ja
va:200)
        at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:419)
        at
org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.jav
a:658)
        at
com.thirdpillar.scoring.ScoringAggregator.listenForMessage(ScoringAggreg
ator.java:102)
        at
com.thirdpillar.scoring.ScoringAggregator.run(ScoringAggregator.java:63)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Wire format negociation timeout: peer
did not send his wire format.
        at
org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNego
tiator.java:88)
        at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:
47)
00:27:19,676 |INFO  - 2008-12-03T00_24_58,379        - Time to Hit
Merlin service :- 0.219 seconds
00:27:19,676 |INFO  - 2008-12-03T00_24_58,379        - -----------Merlin
service call completed-----------
        at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCo
rrelator.java:69)
        at
org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrela
tor.java:74)
        at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection
.java:1175)
        ... 10 more
javax.jms.IllegalStateException: The Session is closed
        at
org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:581
)
        at
org.apache.activemq.ActiveMQSession.getTransacted(ActiveMQSession.java:4
26)
        at
org.springframework.jms.core.JmsTemplate.doReceive(JmsTemplate.java:697)
        at
org.springframework.jms.core.JmsTemplate.doReceive(JmsTemplate.java:676)
        at
org.springframework.jms.core.JmsTemplate$11.doInJms(JmsTemplate.java:661
)
        at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:428)
        at
org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.jav
a:658)
        at
com.thirdpillar.scoring.ScoringAggregator.listenForMessage(ScoringAggreg
ator.java:102)
        at
com.thirdpillar.scoring.ScoringAggregator.run(ScoringAggregator.java:63)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:675)
        at java.lang.Thread.run(Thread.java:595)
javax.jms.JMSException: Wire format negociation timeout: peer did not
send his wire format.
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.
java:58)
        at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection
.java:1185)
        at
org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQ
Connection.java:1263)
        at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.
java:276)

 

My JMSClient is-

 

public static void sendJMSMessageAsynchronously(String message)

                  throws JMSException {

            logger.debug("In sendJMSMessageAsynchronously of
JMSClientUtil");

            try {

                  connectionFactory = new
ActiveMQConnectionFactory(QUEUE_CONFAC);

                  queueConnection =
connectionFactory.createQueueConnection();

                  queueSession =
queueConnection.createQueueSession(false,

                              javax.jms.Session.AUTO_ACKNOWLEDGE);

                  requestQueue = queueSession.createQueue(QUEUE_NAME);

                  queueSender = queueSession.createSender(requestQueue);

                  queueConnection.start();

                  logger.debug("Queue Connection started with queue: " +
QUEUE_CONFAC

                              + " name " + QUEUE_NAME);

                  TextMessage jmsMessage =
queueSession.createTextMessage();

                  jmsMessage.setText(message);

                  queueSender.send(jmsMessage);

            } catch (JMSException ex) {

                  logger.error("Error occured in JMS connection" + ex);

                  throw ex;

            }finally{

                  if (queueSender!=null) queueSender.close();

                  if (queueSession!=null) queueSession.close();

                  if (queueConnection!=null) queueConnection.close();


            }

      }

MY XBean has the below code-

 

MailComponent component = (MailComponent) camel

                                          .getComponent("mail");

endpoint = component.createEndpoint(strEndPoint);

normalizedMessage = reverseExchange.getMessage("in");

                        stringSource = (StringSource)
normalizedMessage.getContent();

Exchange exchange = endpoint.createExchange();

                        Message in = exchange.getIn();

in.setBody(bodyContent);

Producer producer = endpoint.createProducer();

 

                        // start the producer

                        producer.start();

                        LOG.debug("onMessageExchange(): Producer started
successfully");

 

                        // Processes the exchange by sending the email

                        producer.process(exchange);

                        producer.stop();

 

 

 

 

 

 

Richa Khurana| Associate Consultant - Engineering| GlobalLogic Inc.
USA | INDIA | UKRAINE | CHINA
Office: +91.120.406.2681  

www.globallogic.com <http://www.globallogic.com/> 
InfoWorld Award Winner for Agile Innovation
<http://www.globallogic.com/Media/pressReleaseDetail.asp?press/65> 

Disclaimer: http://www.globallogic.com/email_disclaimer.txt
<http://www.globallogic.com/email_disclaimer.txt>