Q1: Can the jndi.properties file be used to define the
JNDI properties such as factory, provider url, and others, in Webpshere
4.0.X?
A1: Yes, the jndi.properties can be used to define the JNDI properties
such as factory, provider URL, and others, it should be put in the system
level CLASSPATH.
Q2: Can the jndi.properties be placed in the CLASSPATH for a particular
application such as a war file and why?
A2: No, if the jndi.properties is placed in the CLASSPATH for a
particular application such as a war file, the jndi.properties file will
be ignored. The class loader implementation getResource() is based on the
java.lang.classloader code. Unfortunately it is marked as final in the
base java.lang.classloader code, so it is always returned from the system
classloader first, the application classloader last. So if it finds the
resource file under system CLASSPATH, it will not check under the
application CLASSPATH.
|