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:// [Root exception is amqp:\ (?????????????????????? ???????????????)]
    at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(
    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(
    at enri.fixm301.semilive.publisher.MessagePublisher.startConnection(
    at enri.fixm301.semilive.publisher.Publish.main(
Caused by: amqp:\ (?????????????????????? ???????????????)
    at Method)
    at<init>(Unknown Source)
    at<init>(Unknown Source)
    at org.apache.qpid.jms.jndi.JmsInitialContextFactory.getInitialContext(
    ... 7 more
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…
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://"); 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://" but the path to JNDI file that contains the connection URL.