p.s. I also have found that
"ant deploy"
will give me the context as desired (if stored in META-INF/context.xml as
recommended by you)
however, "ant install" does not create the same result.
There the context.getInitParameter() and JNDI-configuration
(ResourceLinks) both return null and are not inited correctly.
Thus it seems that "ant deploy" will correctly initialize the Context, but
"ant install" fails to do so.
Working this way, "ant install" seems to be quite useless to me, or does
it have another sense to use it?
thx alot
Johannes
Jacob Kjome <[EMAIL PROTECTED]>
28.03.2003 20:27
Please respond to
"Tomcat Users List" <[EMAIL PROTECTED]>
To
"Tomcat Users List" <[EMAIL PROTECTED]>
cc
Subject
Re: Living without a Context - deploying an application using manager app
What do you mean "Living without a Context"?
Do you mean "living without a Tomcat <Context ...> entry"?
All you have to do is add META-INF/context.xml (the name "context.xml" is
important so don't name it something else) to your .war file. context.xml
is the context configuration file for the context and contains a single
<Context ...> element and any nested elements that the <Context ...>
element supports.
A sample context.xml might look like...
<Context path="/arbitraypath" docBase="dbadmin.war"/>
Note that the "path" can be anything you want, but the docBase must be the
name of the .war file.
I also saw your other message where you said....
<quote>
additionaly, an application deployed using the manager app currently
returns null if you use servletcontext.getRealPath();
so it's context seems to be quite obfuscated...
</quote>
This is to be expected. When you deploy your app as a .war file and not a
directory structure, you have no file system access. If you are counting
of having File IO access to within your webapp, you are creating a
non-portable application. The servlet spec does not guarantee any direct
file system access to any resource on the server other than the directory
path returned by context.getAttribute("javax.servlet.context.tempdir").
there you go.
Jake
At 07:46 PM 3/28/2003 +0100, you wrote:
>hi there,
>
>here are my findings after some experimentation with the ant deploy task
>of the manager app.
>
>*) a complete application can be easily built into a WAR file using ant
>*) this WAR file can be easily deployed using ant deploy task
>*) once deployed onto the server, the application is running with the
>docbase located somewhere under the manager directory:
>ant list
>-> produces:
>"/dbadmin:running:1:F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war"
>
>*) there the application is living
>- without a context
>- thus, also without any JNDI resources etc. defined in server.xml for a
>context dbadmin with docbase dbadmin.
>
>Would renaming the docbase to "
>F:\tomcat-4.1.18\work\Standalone\localhost\manager\dbadmin.war" resolve
>the problem of not having any context?
>What else could be done to get a context for the webapplication
"dbadmin"?
>
>thx
>Johannes