[jboss-user] [JBoss Messaging] - Re: [BisocketServerInvoker] unrecognized listener ID: ...

Smurfs do-not-reply at jboss.com
Thu Apr 26 10:05:22 EDT 2007


Hi Ron,

Thanks for your response. I have spent a bit of time investigating the circumstances that trigger the WARN message, and can advise that it only seems to be triggered after a call to the connection close() method.

If you run the following code snippet in a session bean you ought to be able to replicate what I have been experiencing.


  | @Resource(mappedName="ConnectionFactory")
  | private ConnectionFactory connectionFactory;
  | 	
  | @Resource(mappedName="queue/someQueue")
  | private Destination someQueue;
  | 
  | private void testMDB() {
  | 	Connection connection = null;
  | 	Session session = null;
  | 	MessageProducer producer = null;
  | 	
  | 	try {
  | 		log.info("\n**** MDB example 1 (with finally block) ****");
  | 		connection = connectionFactory.createConnection();
  | 		session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
  | 		producer = session.createProducer(someQueue);
  | 		ObjectMessage message = session.createObjectMessage();
  | 		message.setObject(new String("some serialized object 1"));
  | 		producer.send(message);
  | 		log.info("MDB example 1 dispatched");
  | 		
  | 	} catch (JMSException jmse) {
  | 		log.error("MDB example 1 jms error: " + jmse.getMessage());
  | 		jmse.printStackTrace();
  | 
  | 	} finally {
  | 		try {
  | 			log.info("MDB example 1 - closing connection in finally block");
  | 			if (connection != null)
  | 				connection.close();
  | 		} catch (JMSException jmsex) {}
  | 	}
  | 	
  | 	try {
  | 		log.info("\n**** MDB Example 2 (without finally block) ****");
  | 		connection = connectionFactory.createConnection();
  | 		session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
  | 		producer = session.createProducer(someQueue);
  | 		ObjectMessage message = session.createObjectMessage();
  | 		message.setObject(new String("some serialized object 2"));
  | 		producer.send(message);
  | 		log.info("MDB example 2 dispatched");
  | 			
  | 	} catch (JMSException jmse) {
  | 		log.error("MDB example 2 jms error: " + jmse.getMessage());
  | 		jmse.printStackTrace();
  | 	}
  | 	// No finally block and no WARN message, but connection not closed!
  | 		
  | }
  | 

I trust this clearly demonstrates the issue and clarifies what I previously tried to outline/explain.

Thanks, Andrew

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

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



More information about the jboss-user mailing list