You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jason Pringle <Ja...@amdocs.com> on 2011/02/02 21:47:18 UTC

Is it possible for a web application to populate the global JNDI namespace?

Can a web application populate the global JNDI namespace?

I am looking for a possible workaround to create shared connection pools without modifying server.xml (ie placing entries in <GlobalNamingResources .../>).

If a web application could populate into the global namespace, then I could devise a WAR which defined the desired connection pools and placed them in the global namespace.  Other web applications could then retrieve them as if they had been defined in server.xml.

Thanks!
--Jason




This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

RE: Is it possible for a web application to populate the global JNDI namespace?

Posted by Jason Pringle <Ja...@amdocs.com>.
> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Wednesday, February 02, 2011 1:59 PM
> To: Tomcat Users List
> Subject: Re: Is it possible for a web application to populate the
> global JNDI namespace?
>
> On 02/02/2011 20:47, Jason Pringle wrote:
> >
> > Can a web application populate the global JNDI namespace?
>
> No.

Figured as much


>
> > I am looking for a possible workaround to create shared connection
> pools without modifying server.xml (ie placing entries in
> <GlobalNamingResources .../>).
>
> JMX is probably your best bet but I don't think the necessary API is
> exposed. As always, patches welcome.

Good idea - looking at the mbeans in jconsole I see operations for adding a resource to the global naming resources, but don't see a way to specify all the attributes you need. Or maybe it's just non-obvious.



> > If a web application could populate into the global namespace, then I
> could devise a WAR which defined the desired connection pools and
> placed them in the global namespace.  Other web applications could then
> retrieve them as if they had been defined in server.xml.
>
> Apart from the fact that web application start order is undefined...
>
> Lots of things to go wrong here. If two apps define the same resource,
> which wins?
>
> I'm fine with the JMX bit but much less comfortable with apps using it
> directly.

Your concerns absolutely make sense and are a good reason not to allow this behavior.

--Jason



This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Is it possible for a web application to populate the global JNDI namespace?

Posted by Mark Thomas <ma...@apache.org>.
On 02/02/2011 20:47, Jason Pringle wrote:
> 
> Can a web application populate the global JNDI namespace?

No.

> I am looking for a possible workaround to create shared connection pools without modifying server.xml (ie placing entries in <GlobalNamingResources .../>).

JMX is probably your best bet but I don't think the necessary API is
exposed. As always, patches welcome.

> If a web application could populate into the global namespace, then I could devise a WAR which defined the desired connection pools and placed them in the global namespace.  Other web applications could then retrieve them as if they had been defined in server.xml.

Apart from the fact that web application start order is undefined...

Lots of things to go wrong here. If two apps define the same resource,
which wins?

I'm fine with the JMX bit but much less comfortable with apps using it
directly.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org