Error while connecting with Universal messaging using AMQP

Hello All,

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

env.put(Context.INITIAL_CONTEXT_FACTORY, System.getProperty(“CONTEXT_FACTORY”, “org.apache.qpid.jms.jndi.JmsInitialContextFactory”));
env.put(Context.PROVIDER_URL, System.getProperty(“PROVIDER_URL”, “amqp://lcoalhost:5672”));

Can anyone help me here to connect with Universal messaging with AMQP using java program
JMSTest.java (7.07 KB)

Hi,

What is your IS/UM version that you are dealing connection issue here?

HTH,
RMG

Hello Team,

We are using 9.12 IS/UM.

Thanks,
Ankush Sharma

Hi,

did you notice the typo in URL?

lcoalhost instead of localhost

Regards,
Holger

Good eyes that’s a very good catch :slight_smile:

1 Like

Hello Folks,

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.

Thanks

This has been resolved and the post has not been updated by the user.