File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes commons configuration JNDI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "commons configuration JNDI" Watch "commons configuration JNDI" New topic

commons configuration JNDI

Plow United

Joined: Jan 07, 2012
Posts: 1
Hi everyone! I would like to use Apache Common Configurations to determine my apps current environment (dev, test, production sort of thing). Everything has been super smooth so far except getting JNDI to work. I was thinking of using JNDI to determine the server environment, say something like java:comp/env/target.env and that look-up would return a string, either like "dev", "test" - something like that.

When I debug, I can see my JNDI stuff being loaded in the CompositeConfiguration but I cant seem to get the property to be returned. To elaborate, under the debugger, I can see that there is a JNDI config and I can see my jndi binding in the list of binding, but that config is not being added to the combined list? I have tryed getKeys(); getProperty and the like. I have also tried using both the config.xml file and add jndi to the list and I have tried adding each config separately using addConfiguration.

Is there a trick I am missing? Any help is much appreciated. I guess I could also set a system variable and get the same results - would that be a more portable solution? In my situation, I am using the Maven Jetty plugin to provide a quick a server but the application is deployed to Tomcat servers once they leave my local development environment.

Thanks in advance for any help!!
I agree. Here's the link:
subject: commons configuration JNDI
It's not a secret anymore!