Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

commons configuration JNDI

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!