Commons configuration - JNDIConfiguration - How to?

As @ewernli mentioned, the JEE way to add entries in the JNDI tree is to use env-entry in your deployment descriptor(s) Now, if you don't want to repeat the same env-entry in several deployment descriptors, then there is a service for specifying global JNDI bindings: JNDIBindingServiceMgr Below, the provided jboss-service. Xml example:? Xml version="1.0" encoding="UTF-8"?

> jboss.org 127.0.0.1 key1 value1 key2 value2 jboss:service=Naming.

As @ewernli mentioned, the JEE way to add entries in the JNDI tree is to use env-entry in your deployment descriptor(s). Now, if you don't want to repeat the same env-entry in several deployment descriptors, then there is a service for specifying global JNDI bindings: JNDIBindingServiceMgr. Below, the provided jboss-service.

Xml example: jboss.org 127.0.0.1 key1 value1 key2 value2 jboss:service=Naming If this is not what you are looking for, then I don't understand what you're looking for :) In that case, you should maybe clarify it.

It's exactly that! Thank you so much! – rsilva Feb 1 '10 at 14:35.

I don't know much about Commons Configuration and JNDIConfiguration, but if what you want is a set of key/value pairs, the standard way of doing this as per the JEE specs, is to use env-entry in the web. Xml or ejb.xml. MaxExemptions 10 java.lang.

Integer (example taken from JBoss web conf. Reference. ) These values are bound in the JNDI so they can be looked up or injected.

Thank you ewernli, this will be useful! , however it's not what i'm looking for this specific concern. – rsilva Jan 29 '10 at 11:04.

JNDIConfiguration looks up the configuration data on a JNDI server (in your case, the JBoss JNDI server). However, you still need a way of getting that data into the JNDI server in the first place, and Commons-Configuration won't help you with that. It sounds to me that JNDI isn't what you want, it's just pushing the problem around a bit.

JBoss still needs to store the configuration data somewhere, so you'll still have the same basic problem. If you don't want hard-coded file paths, and you don't want a database, then I suggest you pass in the location of the properties file via a system property, e.g. Java -Dmy.config. Path=/my/config.

Properties com. MyClass Then pass that location to Commons Configuration and let it load your config that way.No hardcoded-paths, no database.

....you still need a way of getting that data into the JNDI server..." - This it's my main question! How to do that? In my case and don't have to concern with an hard coded path in the JNDI server because it is environment dependent and not application dependent, meaning when I'm packaging my app who uses it don't have to place the configuration in some path I decided but can use wherever he/she wanted.

– rsilva Jan 29 '10 at 11:02 Getting stuff in and out of the JNDI server requires a JNDI editor tool. I'm not aware of one that ships with JBoss, but such things must exist somewhere. – skaffman Jan 29 '10 at 11:12.

I usually use Commons Configuration for manage my applications configs. I have used properties files configuration. Now I'm interested in using a JNDIConfiguration but I'm not able to understand how this works reading the documentation or googling it.

Contextualizing, I'm working in webapps running in an JBoss AS. Where will be the properties stored?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions