tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies" <>
Subject RE: JNDI frustration
Date Mon, 14 Jun 2004 02:36:22 GMT
OK, I am stuck. Here are the details:

server.xml, adding to the existing GlobalNamingResources:


    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer"

  <Resource name="bean/RLPEnvironmentFactory" auth="Container"
  <ResourceParams name="bean/RLPEnvironmentFactory">


		<description>Object factory for the RLP

resource listener class:

		try {			
			Context initCtx = new InitialContext();
			Context envCtx = (Context)
			EnvironmentBean bean = (EnvironmentBean)
			rlp = bean.environment();
		} catch(NamingException ne) {
			throw new RuntimeException("Failed to create RLP
environment bean via JNDI.", ne);

I've traced into the call in envCtx.lookup. It finds the name, finds
that it is a reference, and then tries to defererence it. My SPI class
isn't called at this point, instead I just get a NamingException that
does not detail whatever has gone amiss.

I would be less helpless if I understood why this has to be configured
in web.xml at all. If the global config has defined that JNDI has the
ability to come up with an object of my class at a particular name by
calling my factory, what's the web.xml angle?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message