suresh.yemineni 0 Newbie Poster

Using the code for JMS client and did the same as mentioned in the http://www.java2s.com/Code/Java/J2EE/ThisexampleisasimpleJMSclientapplication.htm

and run time exception occured exception is :


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:191)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.java:116)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.<init>(PortMapperClient.java:54)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.<init>(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:291)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:113)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:98)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:613)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.java:1194)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:1949)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:745)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:315)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:33)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory.java:110)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory.java:95)
at HelloWorldMessage.main(HelloWorldMessage.java:21)
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.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClient.java:171)
... 16 more


Please give the solution.. I am running it as a standalone application

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.