[jboss-user] [JBoss Messaging] - javax.jmx.Session & JMS XA Connection Factory

ivan.rododendro do-not-reply at jboss.com
Mon Dec 8 09:37:43 EST 2008


Hello, 
we have a SLSB who register himself as producer of a topic, in post construct we create Conection, Session & Porducer, and in send() we call session.createObjectMessage():

 @PostConstruct
  |     public void postConstruct() {
  |               try {
  |             connection = connectionFactory.createTopicConnection();
  |             session = connection.createSession(true, Session.SESSION_TRANSACTED);
  |             producer = session.createProducer(destination);
  |             producer.setTimeToLive(messageValidityPeriod * 60000);
  |         } catch (final JMSException e) {
  |             logger.error("unable to create JMS producer", e);
  |         }
  |     }

 
  | public void send(final Map<String, String> properties, final ProvisioningEvent event) {
  |         try {
  |             final ObjectMessage message = session.createObjectMessage();
  | 
  |             message.setObject(event);
  |             
  |             [...]
  | 
  |             producer.send(message);
  |   
  |         } catch (final JMSException e) {
  |             if (logger.isInfoEnabled()) {
  |                 logger.info("JMSException: " + e.getMessage());
  |             }
  |         }
  |     }

Connetction Factory is JmsXA.

It worked in JBAS50-CR2 (JBM 1.4.1-CR1 ?), but with JBAS5.0-GA it does not work anymore: 

anonymous wrote : javax.jms.IllegalStateException: The session is closed

on calling  session.createObjectMessage() in method send().

Do the session must be created for each method call?

Thank you
Ivan


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

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



More information about the jboss-user mailing list