On Thu, 2011-09-22 at 13:48 -0700, Leo Donahue - PLANDEVX wrote:
> So what is the difference between having a <env-entry> or
> <resource-ref> in web.xml vs. a <Resource> or <Environment> elements
> in META-INF/context.xml?

Well for starters, the web.xml entries will work in all web containers
whereas context.xml is Tomcat-specific.

But the main driver for me is that I want to deliver a .war that I can
drop into ANY web container and have the users configure the app WITHOUT
touching anything in the .war file. I only mentioned the
META-INF/context.xml approach in my original email to simplify the
discussion here. For Tomcat my real aim would be to drop the META-INF
thing and create an equivalent context.xml in
conf/Catalina/${hostname}/${myappcontext}.xml (this is also broke in
6.0.33). Most app servers provide a means of setting JNDI entries via a
web dashboard or a scriptable interface. Tomcat's Manager web interface
used to support this (or maybe it was an extra).

I believe the the Servlet spec says that <env|resource-ref> entries have
to be in web.xml because they tell the container how to expose JNDI
entries to the app in the java:comp/env context. So as 6.0.33 stands, if
I leave them out of web.xml my app works in Tomcat but it's broke
everywhere else. Not good.

I'm trying to see if I can find the problem and so far it's looking like
it might be in org.apache.catalina.startup.ContextConfig but nothing
definite. Not sure how long I'll pursue this. I've got a life to live
and a project to work on.



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

Reply via email to