This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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!!
It is sorta covered in the JavaRanch Style Guide.
subject: commons configuration JNDI
Similar Threads
Spring JMS Junit problem
Name Space Binding - String problem in 5.1.2
Importing external class files inside a JSP page
Question about auto-deploying WAR files and resulting URL?