Skip to main content

Error in running JMS Example

3 replies [Last post]
petersaam
Offline
Joined: 2008-12-21

Hi All,

I am getting error when i build the HelloWorldMessage Example.

http://www.java2s.com/Code/Java/J2EE/ThisexampleisasimpleJMSclientapplic...

Error Message----------------------------------------------------------------------------

Exception occurred : com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [localhost:7676]. - cause: java.net.ConnectException: Connection refused: connect
com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [localhost:7676]. - cause: java.net.ConnectException: Connection refused: connect
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.getJMSConnectException(ExceptionHandler.java:233)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException(ExceptionHandler.java:180)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClient.java:176)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.java:101)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.(PortMapperClient.java:54)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.(TCPConnectionHandler.java:61)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConnection(TCPStreamHandler.java:102)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionOld(ConnectionInitiator.java:281)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:107)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:92)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:613)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.(ProtocolHandler.java:1194)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:1894)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:712)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.(ConnectionImpl.java:293)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.(UnifiedConnectionImpl.java:33)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory.java:110)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory.java:95)
at jmsdemo.HelloWorldMessage.main(HelloWorldMessage.java:87)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.(Socket.java:366)
at java.net.Socket.(Socket.java:180)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClient.java:156)
... 16 more
-----------------------------------------------------------------

Could you please help me to resolve this issue.

Thanks,
Regards,
Peter.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tarbo
Offline
Joined: 2006-12-18

Looks like you don't have a JMS server listening on port 7676. What you've compiled and run is the client side of the application; you need a server side to actually receive your message and send you a reply.

How you start your server depends on which JMS implementation you're using. Usually, you should be able to run a standalone version somehow.

deepthisrikancherla
Offline
Joined: 2014-02-18

Hi..
i'm entirely new to JMS
while trying to run the same code
i got the same error
i've JBoss server running
do i need any other things??

Thanks in advance..

hegalor
Offline
Joined: 2008-07-21