Hello,
I have a stock Tomcat 5.5.9 with JDK 1.5. This is a fresh install,
nothing has changed.
I am not able to lookup the default simpleValue environment variable
form JNDI with a simple JSP file. Is there anything else I have to do
to move an Environment variable, from GlobalNamingResources, into the
scope of a webapp?
I placed a JSP file into the webapps/ROOT directory, just for testing
(contents below). The last line throws the NamingException because it's
not found. When I remove the last line, I'm able to browse the JNDI
tree, and I get the following output:
From java: : comp: org.apache.naming.NamingContext
From java:comp/ : UserTransaction: org.apache.naming.TransactionRef
From java:comp/ : env: org.apache.naming.NamingContext
From java:comp/ : Resources: org.apache.naming.resources.ProxyDirContext
Any advice on how to expose GlobalNamingResources's Environment
variables into webapps?
Thanks very much,
Seth
Test JSP File, in webapps/ROOT :
<%
javax.naming.Context ctx = new javax.naming.InitialContext();
javax.naming.NamingEnumeration e = ctx.list("java:");
while (e.hasMoreElements()) {
out.println("From java: : " + e.nextElement() + "<br>");
}
e = ctx.list("java:comp/");
while (e.hasMoreElements()) {
out.println("From java:comp/ : " + e.nextElement() + "<br>");
}
e = ctx.list("java:comp/env/");
while (e.hasMoreElements()) {
out.println("From java:comp/env/ : " + e.nextElement() + "<br>");
}
System.out.println(new
javax.naming.InitialContext().lookup("java:comp/env/simpleValue"));
%>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]