• 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

commons configuration JNDI

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic