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 Fri, 14 Jun 2002 16:05:10 GMT

I will send you the config files shortly (they're on a laptop I don't have
access to at the moment).

My situation does have one unique feature. The servlet which is causing
these issues is in a jar which I
have installed under "common/lib". The reason I have done this is because
the servlet acts in a similar
manner to the struts controller servlet, in that it catches all urls and
then dispatches to appropriate
action classes. All action classes are also in this jar so I shouldn't have
any classloader related problems, the web
applications have some config files (accessed via getResourceAsStream) and
JSP files.

That is the only difference I can think of, everything else is normal usage.
As I say I will forward you the files later today or early tomorrow.


----- Original Message -----
From: "Remy Maucherat" <>
To: "Tomcat Developers List" <>
Sent: Friday, June 14, 2002 4:45 PM
Subject: Re: JNDI with a custom factory not working

> > I had a look at the JNDI example, unfortunately it wasn't totally
> > 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
> > some trace
> > into the "init" function of my servlet. It's within the "init" that I do
> > 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
> >
> > I notice that the first time the "init" gets called, the context
> > 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?
> This is a very odd behavior, and I will try to reproduce it. From what
> I've seen in your config, you are using a load-on-startup servlet. Do
> you have anything else which isn't the default ?
> Remy
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message