Here comes what my code looks like, kind of anyway, exception handling omitted. 
I've run the same test setup 4 more times, but I only got the error once more.

@Stateless
public SenderBean implements Sender {
        
        Connection con = null;
        
        
        public void send(Serializable obj, String destination) {
                Session session = con.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
                InitialContext ctx = new InitialContext();
                Destination destination = (Destination) ctx.lookup(destination);
                MessageProducer producer = session.createProducer(destination); 
                ObjectMessage objMsg = session.createObjectMessage(obj);
                producer.send(objMsg);
                session.close();                
        }       
        
        @Postconstruct
        public void init() {
                InitialContext ctx = new InitialContext();
                ConnectionFactory tcf = (ConnectionFactory) 
ctx.lookup("java:/JmsXA");
                con = tcf.createConnection();
        }
        
        @PreDestroy
        public void destroy() {
                con.close();
        }
}

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988955
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to