This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes OpenJMS cannot connect to DB after idle several hours Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "OpenJMS cannot connect to DB after idle several hours" Watch "OpenJMS cannot connect to DB after idle several hours" New topic

OpenJMS cannot connect to DB after idle several hours

Dante Tang

Joined: Oct 15, 2003
Posts: 2
I got a problem... after idle for several hours, when I use the sample program to send presistent message, PersistenceException thrown. The root cause of it is a SQLException, Communication link failure.
The problem remains until I restart OpenJMS server.
Does anyone knows how to tackle this? Is it possible to restart OpenJMS programmatically?
Many Many Thanks in advance.
Best Regards,

Here are the exceptions for your reference:

javax.jms.JMSException: Failed to make message persistent: org.exolab.jms.persistence.PersistenceException:
Failed to add message=ID:193095ea-b867-1004-88f4-6a8c0867c808, destination=MM1InQueue (1)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(
at sun.rmi.transport.StreamRemoteCall.executeCall(
at sun.rmi.server.UnicastRef.invoke(
at org.exolab.jms.server.rmi.RmiJmsServerSession_Stub.sendMessage(Unknown Source)
at org.exolab.jms.client.rmi.RmiJmsSessionStub.sendMessage(
at org.exolab.jms.client.JmsSession.sendMessage(
at org.exolab.jms.client.JmsMessageProducer.sendMessage(
at org.exolab.jms.client.JmsQueueSender.send(
at org.exolab.jms.client.JmsQueueSender.send(
at openjms.examples.client.console.SimpleSender.main(
java.sql.SQLException: Communication link failure:
at Source)
at Source)
at Source)
at Source)
at Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(
at org.exolab.jms.persistence.Messages.add(
at org.exolab.jms.persistence.RDBMSAdapter.addMessage(
at org.exolab.jms.messagemgr.MessageMgr.addPersistentMessage(
at org.exolab.jms.messagemgr.MessageMgr.add(
at org.exolab.jms.server.JmsServerSession.sendMessage(
at org.exolab.jms.server.rmi.RmiJmsServerSession.sendMessage(
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(
at sun.rmi.transport.Transport$
at Method)
at sun.rmi.transport.Transport.serviceCall(
at sun.rmi.transport.tcp.TCPTransport.handleMessages(
at sun.rmi.transport.tcp.TCPTransport$
I agree. Here's the link:
subject: OpenJMS cannot connect to DB after idle several hours
jQuery in Action, 3rd edition