aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Where is the jndi.properties file located in j2ee.jar File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Where is the jndi.properties file located in j2ee.jar File" Watch "Where is the jndi.properties file located in j2ee.jar File" New topic
Author

Where is the jndi.properties file located in j2ee.jar File

ragi singh
Ranch Hand

Joined: Mar 10, 2010
Posts: 198

I am writing code for JMS application .However , I am getting javax.naming.InitialContext exception . Now i want to access jndi.properties file . Can anyone tell me where i can find the jndi.properties file in the j2ee.jar file
Bryan Copeland
Greenhorn

Joined: May 17, 2010
Posts: 3
There's a shortcut which I found after lots of sifting through online resources/specs and


Summary:

1. you just need to create your own jndi.properties like a regular .properties file (start a plaintext file in your IDE and rename .properties, or, just a basic text editor like vi or notepad)

2. set the JMS properties to the location of your actual JMS server, some optional config, and any Topic or Queue names you want to create

3. package the jndi.properties as a .jar and include it in your buildpath (simply add as a library in your IDE and it will automagically add to your buildpath)



My sample jndi.properties for ActiveMQ:





Check these out for more info:
ActiveMQ - http://activemq.apache.org/jndi-support.html
jBoss - http://docs.jboss.org/jbossmessaging/docs/usermanual-2.0.0.beta1/html/using-jms.html
ragi singh
Ranch Hand

Joined: Mar 10, 2010
Posts: 198

Where are we getting the org.apache.activemq.jndi.ActiveMQInitialContextFactory class from ?
How are we setting the java.naming.factory.initial field
Bryan Copeland
Greenhorn

Joined: May 17, 2010
Posts: 3
You need to be sure to include activemq5.3.1-all.jar in your project buildpath, they all come from the ActiveMQ library...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where is the jndi.properties file located in j2ee.jar File