tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30358] New: - Direct JNDI lookup "java:comp/env/cfg/test" fails
Date Wed, 28 Jul 2004 07:15:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30358>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30358

Direct JNDI lookup "java:comp/env/cfg/test" fails

           Summary: Direct JNDI lookup "java:comp/env/cfg/test" fails
           Product: Tomcat 4
           Version: 4.1.27
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina:Modules
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: oliver.henning@aloba.ch


Context ctx = new InitialContext();
Object o=ctx.lookup("java:comp/env/cfg/test"); // Boom, lookup fails

// But this works:
Context ctx = new InitialContext();
ctx=(Context)ctx.lookup("java:comp/env");
Object o=ctx.lookup("cfg/test");

// My server.xml:
<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <Service name="Tomcat-Standalone">
    <Connector ...>
    <Engine name="Standalone" defaultHost="localhost" debug="0">
      <Host name="localhost" debug="0" appBase="." unpackWARs="true"> 
	<Context path="/test" docBase="./web" debug="0" reloadable="false">
	  <Environment name="cfg/test" type="java.lang.String" value="Hello"/> 
	</Context>
      </Host>
    </Engine>
  </Service>
</Server>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message