tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arshad Mahmood" <>
Subject Re: JNDI with a custom factory not working
Date Thu, 13 Jun 2002 18:03:23 GMT
----- Original Message -----
From: "Remy Maucherat" <>
To: "Tomcat Developers List" <>
Sent: Thursday, June 13, 2002 6:51 PM
Subject: Re: JNDI with a custom factory not working

> Arshad Mahmood wrote:
> > 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,
> Indeed, the global resources go into a separate 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.
> Both of these should go in the same context or its subcontexts (for
> example, if your resource is "jdbc/db", then there will be a "jdbc"
> context child of "env", which will contain a "db" entry).
> Did you try to use the JNDI servlet in the servlet examples to see what
> was going on ? I believe it is quite useful for this.

Hmm, I will investigate further. It seemed to be that "ResourceLink" in the
"<Context" entry was going into a naming context with name
"//Standard/myapp" but
the one which I retrieved from the servlet was called
"//Standard/localhost/webapp". I will
debug this further.

I will have a look at the JNDI example servlet. I must confess I was using
JNDI-Howto in the docs.

> > I realise you are incredibly busy, but if you have naming working, can
> > please try and
> > generate one with a custom factory. As I have followed the instructions
> > JNDI-Howto,
> > but the only things in the "bindings" when I retrieve the
> > are the ones I have
> > defined in the web.xml, and these don't allow you to specify a factory.
> If the definitions from web.xml override the ones from server.xml,
> nothing will work (ie, even if you use the default DataSource factory,
> the reference will be missing some attributes).
> You can try removing the definition in web.xml to see what happens.
> BTW, which version of Tomcat are you using ?

The latest version of 4.1 from CVS (although it's a little broken because
does't compile, but I am not using that anyway).

Thanks for your help. I will try and pin the problem down a bit more.


> Remy
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message