You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by JPfernandes <jp...@gmail.com> on 2010/01/20 20:39:03 UTC

Could not connect starting broker as localhost.

Im using activeMQ and starting my server broker like:
//----------------------------------------------------------------
BrokerService broker = new BrokerService();
broker.addConnector("tcp://localhost:61616");				
broker.start();

why when i try to connect to my server using:
connectionFactory = new ActiveMQConnectionFactory(
"tcp://192.168.0.4:61616");

javax.jms.JMSException: Could not connect to broker URL:
tcp://192.168.0.4:61616. Reason: java.net.ConnectException: Connction
refused

and  if i start the server broker with IP instead of 'localhost' it works
well ?

Thanks, JP
-- 
View this message in context: http://old.nabble.com/Could-not-connect-starting-broker-as-localhost.-tp27247367p27247367.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Could not connect starting broker as localhost.

Posted by Gary Tully <ga...@gmail.com>.
localhost binds to the loopback address, an interface that is local to a
host. You can bind to a particular IP address or all interfaces with the
wildcard address 0.0.0.0
For more detail see: https://issues.apache.org/activemq/browse/AMQ-2094

2010/1/20 JPfernandes <jp...@gmail.com>

>
> Im using activeMQ and starting my server broker like:
> //----------------------------------------------------------------
> BrokerService broker = new BrokerService();
> broker.addConnector("tcp://localhost:61616");
> broker.start();
>
> why when i try to connect to my server using:
> connectionFactory = new ActiveMQConnectionFactory(
> "tcp://192.168.0.4:61616");
>
> javax.jms.JMSException: Could not connect to broker URL:
> tcp://192.168.0.4:61616. Reason: java.net.ConnectException: Connction
> refused
>
> and  if i start the server broker with IP instead of 'localhost' it works
> well ?
>
> Thanks, JP
> --
> View this message in context:
> http://old.nabble.com/Could-not-connect-starting-broker-as-localhost.-tp27247367p27247367.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com