tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: deploying war file and "Document base ... does not exist"
Date Sun, 01 Sep 2002 21:35:16 GMT

Yes, but now you are constrained by the fact that the app is running 
directly from myapp.war which means that you have no filesystem access to 
your webapp.  For instance, the following will return null in your setup...

String contextPath = getServletContext().getRealPath("/");

This is because there is no "real path" on your system for your webapp 
since it is running out of an archive, not out of a directory on the 
filesystem.  If you can live with that, then you are good as gold.  If not, 
you will need to read my other reply in this thread.

Jake

At 06:53 AM 9/1/2002 +0000, you wrote:
>I found the answer by carefully reading
>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html
>in the section "Automatic Application Deployment".
>
>Tomcat 4.1+ will automatically deploy myapp.war if the myapp.xml file
>contains
><Context path="/myapp" docBase="myapp.war"
>debug="5" reloadable="true" crossContext="true">
>It failed when I had docBase="myapp" and I needed docBase="myapp.war".
>
>The great thing about this scheme is no one has to edit the server.xml
>file. You can deploy the app by just droppping the myapp.war and
>myapp.xml files into the webapps directory. In older schemes, I had to
>give instructions for editing the server.xml file. Now it's all in the
>myapp.xml file.
>
>Daniel
>kehoe@fortuity.com
>
>
>On Sat, 31 Aug 2002 18:29:41 -0700 (PDT), "garrett smith"
><javadevmac2@yahoo.com> said:
> > Tomcat will unjar (unwar?) the archived file by default. The <Context>
> > entry should be in $CATALINA_HOME/lib/server.xml
> >
> > Garrett
> >
> >
> > --- Daniel Kehoe <kehoe@fortuity.com> wrote:
> > > Using TC4.1.9beta, I've got a myapp.war file (and matching myapp.xml
> > > configuration file) I install successfully using the Tomcat Web
> > > Application Manager. When I put the myapp.war and myapp.xml files in
> > > <tomcat>/webapps and restart Tomcat (for permanent deployment) I get
> > > the message:
> > >
> > > Error initializing resources: Document base
> > > C:\java\tomcat4\webapps\myapp does not exist or is not a readable
> > > directory
> > >
> > > The myapp.xml file contains:
> > > <Context path="/myapp" docBase="myapp"
> > > debug="5" reloadable="true" crossContext="true">
> > > (plus it specifies a dataSource as a resource)
> > >
> > > I know the docbase doesn't yet exist when Tomcat starts because the war
> > > file hasn't been unarchived. How is this supposed to work? Is there an
> > > alternative to specifying the docbase? Do I have to manually unarchive
> > > the war file? It was easy with other apps in TC3.2, I just dropped war
> > > files into webapps and they deployed without any complaints. Maybe I've
> > > overlooked a configuration parameter?
> > > --
> > >   Daniel
> > >   kehoe@fortuity.com
>--
>   Daniel
>   kehoe@fortuity.com
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message