[jboss-user] [Messaging, JMS & JBossMQ] - Re: MDB sending a message

n_sroor do-not-reply at jboss.com
Thu Jul 26 07:02:08 EDT 2007


I use this method to start XAConnection connection:

public void startAsync(StartProcessCommand command) {
		
		if (log.isDebugEnabled()) log.debug("startAsync()");
		
		try {
			
			Destination taskProcessorQueue = (Destination)ctx.lookup("queue/ProcessManager");
			if (log.isDebugEnabled()) log.debug("Destination is: "+taskProcessorQueue+".");
			
			XAConnectionFactory factory = (XAConnectionFactory) ctx.lookup("XAConnectionFactory");
			final XAConnection cnn = factory.createXAConnection();
			final XASession session = cnn.createXASession();
			if (log.isDebugEnabled()) log.debug("Session is transacted: "+session.getTransacted()+".");
			
			cnn.start();
			
			MessageProducer producer = session.createProducer(taskProcessorQueue);
			
			Message aMessage = session.createObjectMessage(command);
			producer.send(aMessage);
			cnn.stop();
			cnn.close();
			
		}
		catch (JMSException e) {
			if (log.isErrorEnabled()) log.error("Error while talking to the ProcessManager:",e);
			// TODO do something
		}
	}


when I run it I get sometimes an Error:

2007-07-23 12:13:54,126 DEBUG [org.hibernate.jdbc.ConnectionManager] 
aggressively releasing JDBC connection
--------------------------------------------------------------
2007-07-23 12:13:54,127 DEBUG [org.jboss.mq.il.uil2.SocketManager] 
Failed to handle: org.jboss.mq.il.uil2.msgs.CloseMsg28691191
[msgType: m_connectionClosing, msgID: -2147393866, error: null]
java.io.IOException: Client is not connected
at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:264)
at org.jboss.mq.il.uil2.SocketManager.sendReply(SocketManager.java:238)
at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg (ServerSocketManagerHandler.java:131)
at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:395)
at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run (PooledExecutor.java:748)
at java.lang.Thread.run(Thread.java:595)
2007-07-23 12:13:54,127 DEBUG [org.jboss.mq.il.uil2.SocketManager]
 Failed to send error reply


Can any one help me why is this happen


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067754#4067754

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067754



More information about the jboss-user mailing list