menu

Questions & Answers

Unable to load property file amqp:

I'm using qpid jms, I'm a client, and using simple monogramming in Eclipse not with Maven or other modules.

Exception in thread "main" javax.naming.NamingException: Unable to load property file: amqp://192.168.130.1:5672. [Root exception is java.io.FileNotFoundException: amqp:\192.168.130.1:5672 (?????????????????????? ???????????????)]
    at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(JmsInitialContextFactory.java:109)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at enri.fixm301.semilive.publisher.MessagePublisher.getInitialContext(MessagePublisher.java:134)
    at enri.fixm301.semilive.publisher.MessagePublisher.startConnection(MessagePublisher.java:138)
    at enri.fixm301.semilive.publisher.Publish.main(Publish.java:38)
Caused by: java.io.FileNotFoundException: amqp:\192.168.130.1:5672 (?????????????????????? ???????????????)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(JmsInitialContextFactory.java:92)
    ... 7 more
Comments:
2023-01-18 00:10:23
The file is not found - how can we help you?
2023-01-18 00:10:23
That is the problem I have configured all types of jars. Also I have searched this file but unfortunately I couldn't find. Please help me I'm really stuck. how can I search this file or solve this problem plz.Thank you
2023-01-18 00:10:23
have a look at the code apache.googlesource.com/qpid-jms/+/…
2023-01-18 00:10:23
private static InitialContext getInitialContext() throws NamingException { Hashtable<Object, Object> env = new Hashtable<Object, Object>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.qpid.jms.jndi.JmsInitialContextFactory"); env.put(Context.PROVIDER_URL, "amqp://192.168.1.1:5672"); env.put(Context.SECURITY_PRINCIPAL, "admin"); env.put(Context.SECURITY_CREDENTIALS, "admin"); return new InitialContext(env); } when object intialiezes it throws exception, Thank you so much Scary Wombat for your support
2023-01-18 00:10:23
were you able to fix it? I am facing the same error too :(
Answers(1) :

I ran into the same issue using QPID JMS from JMeter jms subscriber. That happened because under "Provider URL" QPID expects not URLs like "amqp://192.168.130.1:5672" but the path to JNDI file that contains the connection URL.