----- Original Message ----- From: "Remy Maucherat" <[EMAIL PROTECTED]> To: "Tomcat Developers List" <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 6:27 PM Subject: Re: JNDI with a custom factory not working
> There was a simple bug until very recently which caused the resource > defined in web.xml to override the one defined in server.xml (and then > it didn't work). > This bug has always been there, and it has been fixed to some extent in > 4.1.3, although it is a partial fix (4.1.4 fixes the remaining issues). > > > To look into the problem I put some debug into the > > "org.apache.naming.NamingContext" class in the > > lookup method. > > > > I noticed that when this class was called a few times, the "name" member > > varied between "//Standalone/myapp" amd > > "//Standalone/localhost/myapp", etc. > > There is only one naming context per web application, and it is > instantiated by the NamingContextListener. > > I don't understand how you get into that situation, and it is working > fine for me overall (ie, if I do a lookup in a servlet, it always goes > to the same context). I do get the same context when I ask for it in my web application. The problem is that I can see from the debug that my "Resource" definitions in the global naming resources appear to be in one context, the "ResourceLink" I have defined in the "<Context" for my webapp go into another, but the one I am given when I use a lookup for "java:comp/env" in my servlet init function appears to have only those defined in the web.xml. I realise you are incredibly busy, but if you have naming working, can you please try and generate one with a custom factory. As I have followed the instructions in JNDI-Howto, but the only things in the "bindings" when I retrieve the "java:comp/env" are the ones I have defined in the web.xml, and these don't allow you to specify a factory. > Remy > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>