This content has been marked as final.
Show 4 replies
-
1. Re: Queue - I can send but cannot receive
weston.price Mar 23, 2007 8:27 AM (in response to vitor_b)To do a receive you will need to call start() on the connection. Otherwise, messages will not be delivered. The reason the MDB works is because this is done automagically under the hood for you.
-
2. Re: Queue - I can send but cannot receive
vitor_b Mar 23, 2007 10:34 AM (in response to vitor_b)Thank you for this helpful reply.
I added method start() at the begining and stop() method at the end. But that was not a good move. I received Exception:
javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6
When i removed method stop() everything works fine.consumer.close(); session.close(); //con.stop(); con.close(); ictx.close();
Thanks again. I would have lost much more time if i had not been told what is wrong.
Best regards.
vitor_b -
3. Re: Queue - I can send but cannot receive
genman Mar 23, 2007 2:18 PM (in response to vitor_b)What happens with Connection.start() ?
-
4. Re: Queue - I can send but cannot receive
vitor_b Mar 23, 2007 3:30 PM (in response to vitor_b)With connection.start() everything works fine.
Connection con = cf.createConnection(); con.start(); //new line Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
I had some problems when i added connection.stop() method to my code.
So i removed stop() method call, and again everything works corectly.
Best regards
vitor_b