Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes jndi.properties location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "jndi.properties location" Watch "jndi.properties location" New topic
Author

jndi.properties location

Chris Reeves
Ranch Hand

Joined: Apr 03, 2002
Posts: 95
I have a stand alone app that is generating JMS messages.
I have the client packaged in a jar, and it is placed along with its supporting jars in a /lib directory. The other jars are referenced in the manifest, and the client works as expected. The rest of the client is structured as follows:
/bin - shell script to run client
/conf - config files
/lib - jars
/logs - logs
However, I am struggling with the jndi.properties file. The client is picking up a file somewhere else, as it is not reading the one I have placed in conf (which I reference in the Class-path: in the jar manifest. I tried moving it to /lib, and changing the manifest too, but to no avail.
Where can I place this file so it will be read properly, without having to read it programmatically? I've tried passing it in the classpath from the shell script, but that doesn't work either. If I reference it with -D, what key do I use? -D[key]=conf/jndi.properties
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

I think that that very much depends on what you're using as a jndi server. In the JOnAS system I run here, the JOnAS system comes with its own registry server and it gets its properties from the jonas.properties file.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mat Robinson
Greenhorn

Joined: Aug 02, 2002
Posts: 20
I believe that the file has to be in a directory that is in the classpath (as opposed to the file itself).
Mat.
Chris Reeves
Ranch Hand

Joined: Apr 03, 2002
Posts: 95
A directory, but not a file in the classpath. Well, that seems quite strange, but I'll give it a shot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jndi.properties location
 
Similar Threads
Building a jar with dependancies.
Location of properties jar in an EAR
How to detect a config file when using a shell script to start the app
Best place for .properties file?
Classpath - help!