On Mon, 16 Dec 2002, Anthony Ikeda wrote:

> Date: Mon, 16 Dec 2002 14:16:58 +1100
> From: Anthony Ikeda <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: context.xml inside war and outside
>
> Thanks for clearing that up Craig, however I still have problems with the
> unpackwars attrbiute.
>

I'm not a fan of unpackWARs under any circumstances (if you're installing
WARs you should let Tomcat run from the WAR directly; otherwise you should
be installing an unpacked directory already), but we're stuck with it for
backwards compatibility :-(.

> If I put my Context details in the server.xml file and leave the un-exploded
> war file in web apps, Tomcat starts up but throws an exception:
> java.lang.IllegalArgumentException: Document base
> K:\Extensions\jakarta-tomcat-4.1.12\webapps\reality does not exist or is not
> a readable directory
>         at
> org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:19
> 3)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3397)
>         at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>         at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
>         at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>         at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
>         at
> org.apache.catalina.core.StandardService.start(StandardService.java:497)
>         at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
>         at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>         at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
>
> And I have to explode the war manually before I start the server.
>
> Why????????
>
> My context:
> <Context path="/reality" docBase="reality" debug="5" reloadable="true"
> crossContext="true">...
>
> My Host tag is as such:
> <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
> autoDeploy="true">
>
> I've tried setting the docBase to the war file, but the war isn't exploded
> and it runs off the war file directly. This means, an XML file I use for
> config in my WEB-INF folder is inaccessible. (Unless I move this now to the
> classes folder and load it through a classloader, which means I can't edit
> it, etc, etc...). I know, I know I shouldn't be writing to the web app but I
> need to ;-)
>

I didn't know you could use a WAR file in "webapps" and a <Context>
element at the same time.  If that's what you want, it sounds like time
for a bug report:  <http://nagoya.apache.org/bugzilla/>.

> If all comes to worse, I just move my config to the database instead.
>

Why don't you just stick the context.xml file into "webapps" instead?  It
will still get auto-deployed, and the docBase there can point wherever
you've go the actual webapp.

> Cheers,
> Anthony

Craig


>
> ----- Original Message -----
> From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Monday, December 16, 2002 12:01 PM
> Subject: Re: context.xml inside war and outside
>
>
> >
> >
> > On Mon, 16 Dec 2002, Anthony Ikeda wrote:
> >
> > > Date: Mon, 16 Dec 2002 11:08:51 +1100
> > > From: Anthony Ikeda <[EMAIL PROTECTED]>
> > > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Subject: context.xml inside war and outside
> > >
> > > I have moved my Context declarations from the server.xml file to a
> > > META-INF/context.xml file in my war file.
> >
> > IIRC, that will only work if you use the "deploy" command of the manager
> > webapp to deploy the app.  It's not recognized by the auto-deploy of WAR
> > files in the "webapps" directory, or for contexts installed with the
> > "install" command.
> >
> > Craig
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
> >
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to