Reconnecting to a JMS Queue (J2EE RI)

M

Marius

Hi All,

I am having a hard time getting a "jms queue connection watcher" to
work with the J2EE Reference Implementation 1.3.1. What I need to do
is monitor the status of a JMS server and, in case it goes down, try
to reconnect to it when it's brought up again, without having to
restart the client.
I have a client that periodically does a count of the messages in a
queue. If this fails for any reason, this operation is retried and,
when successful, the real connections are recreated. The scenario is
the following:
1. Bring up the j2ee server (btw, I have created all needed objects -
queue factories, queues)
2. Connect to it and count the messages in Queue Q1. This operation
is repeated everyt 10 seconds.
3. Take down j2ee (I do it cleanly: j2ee -stop)
4. Client reports
javax.naming.CommunicationException: java.rmi.MarshalException:
CORBA COMM_FAILURE 1398079689 No; nested exception is:
org.omg.CORBA.COMM_FAILURE: minor code: 1398079689 completed: No
5. Client continues to hit the jms server. Same error is reported.
6. Bring up the J2EE server. Client will never reconnect. The same
exception as above keeps being thrown.

I am wondering whether there is a bug in the j2ee implementation. I
searched the Internet, try changing classpaths (to point to locale,)
added
com.sun.jms.internal.java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory

to jms_client.properties and jms_service.properties, etc; nothing
worked.
I noticed that, when I create a queue connection the first time the
line "Java(TM) Message Service 1.0.2 Reference Implementation (build
b14)" is printed on the console, and this never happens again (after
closing the queue connection).
I tried my code with Tibco JMS provider and it worked perfectly...

Any clue will be greatly appreciated. Thanks in advance,
Marius

P.S. My first implementation used the ExceptionListener but, again
J2EE didn't work (didn't call my callback method when the connection
went down). Anyway, this is another problem...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

J2EE JMS 0
JMS scalability question 13
J2EE JMS problem 2
J2EE JMS problem 4
JMS vs Sockets -- bandwidth, size, speed, etc. 39
How does JMS correlation work in Java? 0
JMS + glassfish 0
Throttle JMS queue connection 0

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top