Home  >  Forum  >  Java EE
Post New Query

java.net.ConnectException: Connection refused: connect


joined on
March 27,2014
Asked on March 27,2014
Hi I am new to JMS and trying to run the simple program and got the below error.
Need help.


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.throwConnectionException(ExceptionHandler.java:280)
    at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException(ExceptionHandler.java:226)
    at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClient.java:247)
    at com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.java:156)
    at com.sun.messaging.jmq.jmsclient.PortMapperClient.<init>(PortMapperClient.java:90)
    at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.<init>(TCPConnectionHandler.java:130)
    at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConnection(TCPStreamHandler.java:136)
    at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.openConnection(ConnectionInitiator.java:419)
    at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionOld(ConnectionInitiator.java:369)
    at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:216)
    at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionInitiator.java:164)
    at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:843)
    at com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.java:1562)
    at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:2383)
    at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:1064)
    at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:442)
    at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:66)
    at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory.java:153)
    at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory.java:138)

Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at com.sun.messaging.jmq.jmsclient.PortMapperClient.makeSocketWithTimeout(PortMapperClient.java:274)
    at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClient.java:226)
    ... 17 more
joined on
October 10,2013
Replied on April 03,2014

1. Check if server is running

2. Check that have you provided correct connection url  

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us