Hi,
I'm just discovering Tomcat 5, and I've been spending almost all day trying
to find a solution to deploy a WAR packaged servlet that has to connect
itself to a global data source resource (ORACLE database).
To set up the connections, I first did the things manually. From within the
web Administration Tool I executed the followin actions:
a) I configured a GLOBAL [Data Source] resource
b) I declared a local (CONTEXT or application specific) [Resource Link]
pointing to the GLOBAL [Data Source]
Great, everything works fine so far: I can see my data !
But then, I thought, it would be great if I could separate server specific
tasks (like declaring GLOBAL resources) from servlet specific tasks (like
declaring local links to these external resources). So, I could have a
global resource called [MyGlobalDatabase] that could be configured in
different ways on different Tomcat servers (on a test server, this resource
could point to a test database...).
On the other hand, the only thing my servlets should be aware of, is that
they will find a global resource called [MyGlobalDatabase] on their Tomcat
server. They don't need to know what's the actual configuration behind this
resource name, but they need to know how to connect to that resource. This
is specially important during servlet deployment: I would like to package my
servlets in a way that no manual intervention is required by the Tomcat
server administrator (except, of course, loading the *.WAR package) !
So I read all the documentation I could find about this topic, and I
discovered that it was possible to define context specific resources from
within a *.WAR file. All I was supposed to do, was to create a /META-INF/
directory containing a [context.xml] file, and declare my links from within
that file !
I followed all the steps, but when I deployed my *.WAR file, the link was
not set up correctly. I checked the CONTEXT specific resources of my servlet
from within the Administration Tool, and there wasen't any link declared.
So I had a look at my ${tomcat_root}\conf\Catalina\localhost directory to
see if my [myservlet.xml] file was there, and here comes the surprise:
There was indeed something called [myservlet.xml] at that place: but it
wasn't an *.xml file... It was an empty directory !!!!!!!
My question: did someone already succeed in deploying a servlet using a
/META-INF/context.xml file with Tomcat 5 (OS: W2K), or is this a known bug,
and all I can do is to wait for a new release of Tomcat ?
Thank you very much for your help,
D. Campi
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]