I am trying to connect with Universal messaging using AMQP protocol from Java program. But I am getting below error:
“ javax.naming.NamingException: Unable to load property file: amqp://lcoalhost:5672. [Root exception is java.io.FileNotFoundException: amqp:\lcoalhost:5672 (The filename, directory name, or volume
label syntax is incorrect)]at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(JmsInitialContextFactory.java:109) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)”
I have done all initial steps in Enterprise Manager
like enabled the Protocol AMQP config, created nsp interface with port 5672
Also added all qpid*jars in java build path.
I am using below code in java class to connect: Also attached
Again I am getting same error :
"error:javax.naming.NamingException: Unable to load property file: amqp://localhost:5672. [Root exception is java.io.FileNotFoundException: amqp:\localhost:5672 (The filename, directory name, or volume label syntax is incorrect)]
at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(JmsInitialContextFactory.java:109)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.(InitialContext.java:216)
at JMSTest.doIt(JMSTest.java:115)
at JMSTest.main(JMSTest.java:64)
I believe for this to work, we need to create a jndi properties file with following information like
java.naming.factory.initial
queue.
topic.
connectionfactory.
And in provider URL we have to provide the location of this JNDI file instead.