Yeah, I'm closing it. Here's the actual producer code that I'm using. No
exceptions from this method are thrown. Instead, they're thrown after this
method returns and before my next line of code. It's pretty straight
forwards as I use this code elsewhere also. The queue exists before this
method is called. I can verify that on the agent view on 8082.

--- snip ---

public void assignToQueue(BuildObj bInfo) {

      Context ctx = null;

      Queue queue = null;
      QueueSender sender = null;
      QueueSession session = null;
      QueueConnection connection = null;
      QueueConnectionFactory connectionFactory = null;

    try {
         ctx = new InitialContext();
      }
      catch (NamingException ne) {
         ne.printStackTrace();
         log.error(Manager.class, "Could not create JNDI context");
      }

      try{
         connectionFactory = (QueueConnectionFactory)
            ctx.lookup("QueueConnectionFactory");

         connection = connectionFactory.createQueueConnection();

         session = connection.createQueueSession(false,
            Session.AUTO_ACKNOWLEDGE);

         connection.start();

         System.out.println("queue/" + bInfo.getName());
         queue = (Queue)ctx.lookup("queue/" + bInfo.getName());

         sender = session.createSender(queue);

         ObjectMessage message = session.createObjectMessage();
         message.setObject(bInfo);

         sender.send(queue, message);
      }
      catch (NamingException ne) {
         ne.printStackTrace();
         log.error(Manager.class, ne.getMessage());
      }
      catch (JMSException jmse) {
         jmse.printStackTrace();
         log.error(Manager.class, jmse.getMessage());
      }
     finally {
         try {
            if (session != null) {
               session.close();
            }

            if (connection != null) {
               connection.close();
            }
         }
         catch (Exception e) {
            log.error(Manager.class, e.getMessage());
         }
      }

   return;
}

----- Original Message -----
From: "Alex Loubyansky" <[EMAIL PROTECTED]>
To: "G.L. Grobe" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, June 27, 2002 1:44 AM
Subject: Re: [JBoss-user] is this a JMS problem?


> Hello G.L.,
>
> do you close the connection in the method? Could you detail what is done
> is the method?
>
> Wednesday, June 26, 2002, 11:11:02 PM, you wrote:
>
> GLG> I have a method A that creates a JMS producer to send a message to a
> GLG> consumer. After it completely returns from that method and before it
> GLG> executes my next line of code I get the following warning (and my
> GLG> message is never recv'd by the consumer).
>
> GLG> Anyone have any ideas how to go about figuring this out, what it may
mean, anything?
> GLG> Any help much appreciated!
> GLG> ---
>
> GLG> [WARN,TxCapsule] XAException: tx=XidImpl [FormatId=257,
GlobalId=cassia//30,
> GLG> BranchQual=] errorCode=XAER_RMERR
> GLG> javax.transaction.xa.XAException
> GLG>         at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:102)
> GLG>         at
org.jboss.tm.TxCapsule.commitResources(TxCapsule.java:1490)
> GLG>         at org.jboss.tm.TxCapsule.commit(TxCapsule.java:324)
> GLG>         at
org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:76)
> GLG>         at
> GLG>
org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:314)
> GLG>         at
> GLG>
org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageCons
> GLG> umer.java:565)
> GLG>         at
> GLG>
org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:376)
> GLG>         at org.jboss.mq.SpySession.run(SpySession.java:248)
> GLG>         at
org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:172)
> GLG>         at
> GLG>
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.ja
> GLG> va:725)
> GLG>         at java.lang.Thread.run(Thread.java:484)
>
> --
> Best regards,
>  Alex Loubyansky
>
>
>
>
> -------------------------------------------------------
> Sponsored by:
> ThinkGeek at http://www.ThinkGeek.com/
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>



-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to