Title: help on JMS Connection's ExceptionListener
As an alternative to subclass NON-WORKing ExceptionListener (JBoss2.4.4) to receive ConnectionBroken exception, i am trying to write code to resend message on sender side upon JMSException, and my receiver will always restarts with JMS server, (so I don't have to rebuild connection for receivers). However, I got this error while trying to retrieve QueueConnectionFactory from InitialContext. Here is what I am doing:
+ reusing existed InitialContext.
+ Connection.close() before recreate queue connection, and I expect it to release all the external resources (of course, close() throws some exceptions about not able to unsubscribe from server)
 
PLEASE HELP!
 
ERROR [main] (iCCCategory.java:184) - Lookup Connection Factory fails
java.rmi.ConnectException: Connection refused to host: 172.16.19.153; nested exception is:
java.lang.NullPointerException
 java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
 at java.net.Socket.<init>(Socket.java:273)
 at java.net.Socket.<init>(Socket.java:100)
 at com.solipsa.messaging.jms.iCCMessageService.getNewJMSConnection(iCCMessageService.java:511)
 at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
 at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:120)
 at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
 at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
 at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
 at com.solipsa.messaging.jms.iCCMessageService.handleSendMessageException(iCCMessageService.java:480)
 at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
 at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
 at javax.naming.InitialContext.lookup(InitialContext.java:350)
 at com.solipsa.messaging.jms.vendor.iCCJBossJMS.getQueueConnectionFactory(iCCJBossJMS.java:234)
 at com.solipsa.messaging.jms.iCCMessageService.sendMessage(iCCMessageService.java:462)
 at com.solipsa.messaging.jms.iCCMessageService.getNewJMSConnection(iCCMessageService.java:499)
 at com.solipsa.messaging.jms.iCCMessageService.handleSendMessageException(iCCMessageService.java:480)
 at com.solipsa.messaging.jms.iCCMessageService.sendMessage(iCCMessageService.java:462)
 at TestJMSConnectionRecovery.main(TestJMSConnectionRecovery.java:42)
 at TestJMSConnectionRecovery.main(TestJMSConnectionRecovery.java:42)
 
 
Thanks a lot!
Sheng

Reply via email to