aspose file tools*
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
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
Author

OpenJMS cannot connect to DB after idle several hours

Dante Tang
Greenhorn

Joined: Oct 15, 2003
Posts: 2
Hi,
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,
Dante

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(StreamRemoteCall.java:245)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at org.exolab.jms.server.rmi.RmiJmsServerSession_Stub.sendMessage(Unknown Source)
at org.exolab.jms.client.rmi.RmiJmsSessionStub.sendMessage(RmiJmsSessionStub.java:174)
at org.exolab.jms.client.JmsSession.sendMessage(JmsSession.java:676)
at org.exolab.jms.client.JmsMessageProducer.sendMessage(JmsMessageProducer.java:238)
at org.exolab.jms.client.JmsQueueSender.send(JmsQueueSender.java:156)
at org.exolab.jms.client.JmsQueueSender.send(JmsQueueSender.java:113)
at openjms.examples.client.console.SimpleSender.main(SimpleSender.java:141)
org.exolab.jms.persistence.PersistenceException:
java.sql.SQLException: Communication link failure: java.io.IOException
at org.gjt.mm.mysql.MysqlIO.clearAllReceive(Unknown Source)
at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(Unknown Source)
at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:207)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:207)
at org.exolab.jms.persistence.Messages.add(Messages.java:190)
at org.exolab.jms.persistence.RDBMSAdapter.addMessage(RDBMSAdapter.java:365)
at org.exolab.jms.messagemgr.MessageMgr.addPersistentMessage(MessageMgr.java:369)
at org.exolab.jms.messagemgr.MessageMgr.add(MessageMgr.java:281)
at org.exolab.jms.server.JmsServerSession.sendMessage(JmsServerSession.java:350)
at org.exolab.jms.server.rmi.RmiJmsServerSession.sendMessage(RmiJmsServerSession.java:174)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
at java.lang.Thread.run(Thread.java:484)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OpenJMS cannot connect to DB after idle several hours