Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 30667 invoked from network); 14 Nov 2003 10:47:51 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 14 Nov 2003 10:47:51 -0000 Received: (qmail 45729 invoked by uid 500); 14 Nov 2003 10:47:04 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 45703 invoked by uid 500); 14 Nov 2003 10:47:04 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 45677 invoked from network); 14 Nov 2003 10:47:03 -0000 Received: from unknown (HELO thor.exolution.de) (212.18.2.65) by daedalus.apache.org with SMTP; 14 Nov 2003 10:47:03 -0000 Received: from loki.exolution.lan (root@loki.exolution.lan [192.168.1.100]) by thor.exolution.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id hAEAlGwF030678 for ; Fri, 14 Nov 2003 11:47:16 +0100 Received: from loki.exolution.lan (monsorno@localhost [127.0.0.1]) by loki.exolution.lan (8.12.3/8.12.3/Debian-6.6) with ESMTP id hAEAlGtD010554 for ; Fri, 14 Nov 2003 11:47:16 +0100 Received: (from monsorno@localhost) by loki.exolution.lan (8.12.3/8.12.3/Debian-6.6) id hAEAlG12010552; Fri, 14 Nov 2003 11:47:16 +0100 Message-Id: <200311141047.hAEAlG12010552@loki.exolution.lan> X-Authentication-Warning: loki.exolution.lan: monsorno set sender to lists@exolution.de using -f To: tomcat-user@jakarta.apache.org Subject: JNDI-lookup fails with GlobalResources From: Martin Monsorno Date: Fri, 14 Nov 2003 11:47:15 +0100 User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Reasonable Discussion, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi *, I recently installed tomcat 4.1.29 and deployed a web application on it via a war-file. The provided server.xml contains the following lines: ,---- | ... | | | | | | | ... `---- My application tries to read this value through a JNDI lookup with this code: ,---- | LOG.debug("testing jndi lookup ..."); | try { | Context initCtx = new InitialContext(); | Context envCtx = (Context) initCtx.lookup("java:comp/env"); | | String jndikey = "simpleValue"; | | LOG.debug("envCtx.lookup(\""+jndikey+"\")="+envCtx.lookup(jndikey)); | } catch (NamingException exc) { | LOG.warn("cannot init from JNDI context", exc); | } | LOG.debug("jndi test end."); `---- which leads to the log output: ,---- | 2003-11-14 10:33:06,237 DEBUG (myapp.InitializationServlet.testJNDI(InitializationServlet.java:67)) - testing jndi lookup ... | 2003-11-14 10:33:06,245 WARN (myapp.InitializationServlet.testJNDI(InitializationServlet.java:76)) - cannot init from JNDI context | javax.naming.NameNotFoundException: Name simpleValue is not bound in this Context | at org.apache.naming.NamingContext.lookup(NamingContext.java:811) | at org.apache.naming.NamingContext.lookup(NamingContext.java:194) | at myapp.InitializationServlet.testJNDI(InitializationServlet.java:74) | at myapp.InitializationServlet.init(InitializationServlet.java:29) | ... `---- So obviously, putting values into JNDI context fails. (If I set the value in web.xml instead as an , everything goes well.) Have I forgotten to do some additional initialization or configuration or something else? Any ideas? Thanks in advance, Martin. -- Martin --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org