Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 79781 invoked from network); 14 Jun 2002 10:42:34 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 14 Jun 2002 10:42:34 -0000 Received: (qmail 8738 invoked by uid 97); 14 Jun 2002 10:42:29 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 8722 invoked by uid 97); 14 Jun 2002 10:42:29 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 8708 invoked by uid 98); 14 Jun 2002 10:42:28 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <063c01c21390$2e04cc80$0b8c0b0a@vnu.co.uk> From: "Arshad Mahmood" To: "Tomcat Developers List" References: <20020612095657.39532.qmail@icarus.apache.org> <3D071D0D.1020501@fujitsu-siemens.com> <01fa01c21206$b893e880$0b8c0b0a@vnu.co.uk> <200206130048.g5D0m0fA016177@darwinsys.com> <026c01c212d5$a42b9990$0b8c0b0a@vnu.co.uk> <3D08C955.4050804@apache.org> <037b01c212fd$618a61c0$0b8c0b0a@vnu.co.uk> <3D08D5F1.6030401@apache.org> <03b901c21301$3fcc8be0$0b8c0b0a@vnu.co.uk> <3D08DBA1.4060501@apache.org> <03ed01c21304$9c3fd0a0$0b8c0b0a@vnu.co.uk> <3D08E03D.2080609@apache.org> Subject: Re: JNDI with a custom factory not working Date: Fri, 14 Jun 2002 11:42:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N From: "Remy Maucherat" To: "Tomcat Developers List" Sent: Thursday, June 13, 2002 7:11 PM Subject: Re: JNDI with a custom factory not working > Arshad Mahmood wrote: > > Hmm, I will investigate further. It seemed to be that "ResourceLink" in the > > server.xml > > " > "//Standard/myapp" but > > the one which I retrieved from the servlet was called > > "//Standard/localhost/webapp". I will > > debug this further. > > The context name is not important for the global context. The > ResourceLink are actually yet another reference which is bound into the > webapp naming context, and use a standard JNDI object factory > (factory.ResourceLinkFactory). The lookup in the actual global context > then just uses a static reference instead of another lookup. I had a look at the JNDI example, unfortunately it wasn't totally relevant as everything is defined in the web.xml and that has always worked for me. After a lot more debugging and I am getting even more confused (!!!). I put some trace into the "init" function of my servlet. It's within the "init" that I do the JNDI name lookups. The "init" gets called twice per servlet. On the first call everything is OK and my lookup succeeds. The second time however the lookup fails with a NamingException. I notice that the first time the "init" gets called, the context returned has the bindings I expect. The second call to "init" which performs identical processing gets a NamingContext with nothing bound (I don't have any entries in the web.xml, had I defined any I think they would be the only entries there). It also looked like the two inits were done by different class loaders, as I defined some static members and they were not carried across to the second init. Can anybody explain why the "init" may be called twice? > > I will have a look at the JNDI example servlet. I must confess I was using > > the > > JNDI-Howto in the docs. > > Which may not be totally accurate, and don't talk at all about how it > actually works. > > > The latest version of 4.1 from CVS (although it's a little broken because > > MBeanUtils > > does't compile, but I am not using that anyway). > > Really ? It does build for me. What's the problem ? > I do get an exception on shutdown, or when removing a context, though. Sorry, ant problems. I think the date on my machine may be a bit slow and hence when I did an update it didn't recompile everything. Regards. > To unsubscribe, e-mail: > For additional commands, e-mail: > -- To unsubscribe, e-mail: For additional commands, e-mail: