-
1. Re: spi's jndi.properties not visible when deploying in a .
cridam44 Feb 13, 2003 3:29 AM (in response to cridam44)After debugging, it seems the sun internal classes of JNDI uses the Thread.contextclassloader for finding "jndi.properties".
The MBean that makes the jndi.lookup has a UnifiedClassLoader whose description is url=file:/opt/jboss-3.0.4_tomcat-4.1.12/server/jboss1/tmp/deploy/server/jboss1/deploy/spi-service.xml/101.spi-service.xml
Note that the test is directly done is the MBean's constructor. and the MBean has no jboss specific interface (i.e not ServiceMBean...).
the spi-service.xml is <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
jboss:service=Naming
However the mbean.class.getClassLoader() is relative to SpiLoader.jar. If i add jndi.properties in the SpiLoader.jar (instead of Spi.jar), classloader.getResources("jndi.properties") returns the url.
Why doesn't the threadcontextclassloader.getResources("jndi.properties") find the resource ?
Chris. -
2. Re: spi's jndi.properties not visible when deploying in a .
adrian.brock Feb 13, 2003 3:38 AM (in response to cridam44)Because there is a jndi.properties in server/jboss1/conf
and this has already been loaded by the naming service.
If you create a sar it will look locally in the
sar before searching the UnifiedLoaderRepository.
deploy/spi.sar
deploy/spi.sar/META-INF/jboss-service.xml
deploy/spi.sar/jndi.properties
deploy/spi.sar/spi.jar
deploy/spi.sar/spiloader.jar
Is there a reason why you cannot add the config to
jndi.properties in conf, other than you can't hot deploy
the jars because they need to be in server/jboss1/lib?
Regards,
Adrian