• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 198
Oracle Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 198
Oracle Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to be sure to include activemq5.3.1-all.jar in your project buildpath, they all come from the ActiveMQ library...
 
reply
    Bookmark Topic Watch Topic
  • New Topic