Reconnection to a receive queue after a network failure

Hello I have an issue that I have been trying to resolve.

For a remote application trying to connection to a JMS server on another machine, if there is a network failure, I can't get it to reconnect with the previously established queue and receive any messages. Just to let you know I do not currently have the enterprise edition.

Here is the recieve code that I currently have.

public void run() {

try {

queueConnectionFactory =

SampleUtilities.getQueueConnectionFactory();

queueConnection =

queueConnectionFactory.createQueueConnection();

queueConnection.setExceptionListener(this);

queueSession = queueConnection.createQueueSession(false,

Session.AUTO_ACKNOWLEDGE);

queue = (Queue) SampleUtilities.jndiLookup(queueName);

queue = (javax.jms.Queue) SampleUtilities.jndiLookup(queueName);

} catch (JMSException e) {

fireJMSEvent("JMS Exception");

} catch (NamingException e) {

fireJMSEvent("Invalid name supplied");

} catch (NullPointerException e) {

fireJMSEvent("No name supplied");

} catch (Exception e) {

fireJMSEvent("Server not available");

}

/*

* Create session and receiver.

* Register message listener (TextListener).

* Start message delivery; listener displays the message obtained.

*/

try {

if (queue != null) {

queueReceiver = queueSession.createReceiver(queue);

textListener = new TextListener();

queueReceiver.setMessageListener(textListener);

queueConnection.start();

// if successful to this point send back to calling app that the server is set up

fireJMSEvent("Server Started");

while (true) {

try {

Thread.sleep(1000);

} catch (InterruptedException e) {

e.printStackTrace();

System.out.println(e.toString());

}

}

}

} catch (JMSException e) {

onException(e);

} finally {

if (queueConnection != null) {

try {

queueConnection.close();

} catch (JMSException e) {

onException(e);

}

}

}

} // End of run()

Can anybody help me?

Thanks in advance

[2225 byte] By [Brian_Loughead] at [2007-11-25 21:54:10]
# 1
what type of problem are you having with reconnection ?Are you seeing an error on the client (and if so, what is it) or is it just not trying to reconnect
Linda_Schneider at 2007-7-5 1:10:38 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 2
No error not just reconnecting or if it is it's no longer receiving any messages
Brian_Loughead at 2007-7-5 1:10:38 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...