Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to connect to java.naming.provider.url value

 
pramod talekar
Ranch Hand
Posts: 345
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Today is my first day with jms & jndi and I'm using ActiveMQ 5.4.3.
I've created a code to test it, but when I run the code I get
javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: connect


This is my jndi.properties file in the classpath


I went over my ActiveMQ configuration file and saw this tag :-


So, I changed it to localhost and reran my code but got the same error, also changed the provider url to 0.0.0.0 in jndi.properties and reran the program but it gave the same error with 0.0.0.0 instead of localhost.

Please help.
 
Anurag Verma
Ranch Hand
Posts: 168
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have already mentioned the issue here -
Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: connect


Check whether server is running on 61616 port.
 
pramod talekar
Ranch Hand
Posts: 345
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anurag.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic