You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Phillips <pa...@partitura.com> on 2002/08/10 05:41:11 UTC

context problem with webapp connector

Tomcat 4.0.4 + Apache 1.3...

I have setup the mod_webapp connector and it sort of works...

However, I have a context in my tomcat server.xml file that looks like this:

        <Context path="/tester" docBase="tester" debug="0" 
reloadable="false">
        <Parameter name="userdatadirectory" value="/pathToData" 
override="false" />
        </Context>

Now, when I access my servlet directly into Tomcat standalone like this:

http://URL:8080/tester/etc -- the parameter is passed to my application 
just fine.

However, when I access my servlet through warp like this:

http://URL/tester/etc -- the parameter doesn't get passed.

I don't know why..

This is a stock Tomcat and Apache setup - the only thing I did was add 
mod_webapp and modify the apache configs according to the documentation.

Other than the parameter passing not working, the webapp connector seems to 
work.
-- that is:

http://URL/examples/etc work fine.

In a blind attempt to make it work, I added a <host><context (same as 
above) ></context></host>  to the warp connector section near the bottom of 
the Tomcat server.xml.  That didn't seem to help any.

Any ideas?

Thanks
Paul Phillips

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: unpacking of WAR

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Sat, 10 Aug 2002, Andrew wrote:

> Date: Sat, 10 Aug 2002 12:18:50 -0400
> From: Andrew <an...@attbi.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: 'Tomcat Users List' <to...@jakarta.apache.org>
> Subject: RE: unpacking of WAR
>
> Craig, I was under the impression that the WAR would only be expanded if
> there was no existing Context of that name.  Is this correct?
>

That's true.  And any auto-expanded directory will *not* be modified if
you update the WAR and restart Tomcat.  That's because people would still
modify the deployed files (in the expanded directory) instead of going
back to their original sources, and get annoyed when their in-place
updates got wiped out.

Personally, I never use the webapps directory any more -- the custom Ant
install and deploy tasks (Tomcat 4.1.x) are really cool.  My normal
development cycle for a webapp:

* Start Tomcat and just leave it running (if not already started)

* Run "ant compile" to build my webapp into a "build/webapp" subdirectory

* Run "ant install" to dynamically install it on Tomcat, passing the
  directory name of my "build/webapp" directory.

* If I need to modify something, I do it and run "ant compile reload"
  to reload the app.

* To clean up, "ant remove".

There's a fully worked out build.xml file that supports all of this in the
Application Developer's Guide document that ships with Tomcat 4.1.

  http://localhost:8080/tomcat-docs/appdev/

The 4.1.x codebase is nearing release quality; you should really start
playing with the new features if you haven't yet.  You'll never go back to
the "webapps" directory again :-).

> - Andrew
>

Craig


> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:craigmcc@apache.org]
> > Sent: Saturday, August 10, 2002 1:01 AM
> > To: Tomcat Users List
> > Subject: Re: unpacking of WAR
> >
> >
> >
> >
> > On Fri, 9 Aug 2002, Paul Phillips wrote:
> >
> > > Date: Fri, 09 Aug 2002 22:49:00 -0500
> > > From: Paul Phillips <pa...@partitura.com>
> > > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > > To: Tomcat Users List <to...@jakarta.apache.org>
> > > Subject: unpacking of WAR
> > >
> > > I worked on deploying my first webapp to another server today.  I
> > > packaged it up as a war, transferred it to the other tomcat server,
> > > added the one line context element in the server.xml, and
> > restarted.
> > > Nothing - the logs said that the webapp that was referenced by the
> > > context statement was not available or in a readable
> > format.  In fact,
> > > the war did not expand into the file system.
> > >
> > > So, I removed the context element, and restarted.  With the context
> > > gone, the WAR expanded properly.  Then I added the context back in,
> > > and it worked fine.
> > >
> > > Is this normal?
> > >
> >
> > Depends on what you specified for the docBase parameter in
> > the Context element.  This needs to be the absolute or relative (to
> > $CATALINA_HOME/webapps) name of the WAR file.
> >
> > Craig
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> > For
> > additional commands,
> > e-mail: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: unpacking of WAR

Posted by Andrew <an...@attbi.com>.
Craig, I was under the impression that the WAR would only be expanded if
there was no existing Context of that name.  Is this correct?

- Andrew

> -----Original Message-----
> From: Craig R. McClanahan [mailto:craigmcc@apache.org] 
> Sent: Saturday, August 10, 2002 1:01 AM
> To: Tomcat Users List
> Subject: Re: unpacking of WAR
> 
> 
> 
> 
> On Fri, 9 Aug 2002, Paul Phillips wrote:
> 
> > Date: Fri, 09 Aug 2002 22:49:00 -0500
> > From: Paul Phillips <pa...@partitura.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: Tomcat Users List <to...@jakarta.apache.org>
> > Subject: unpacking of WAR
> >
> > I worked on deploying my first webapp to another server today.  I 
> > packaged it up as a war, transferred it to the other tomcat server, 
> > added the one line context element in the server.xml, and 
> restarted.  
> > Nothing - the logs said that the webapp that was referenced by the 
> > context statement was not available or in a readable 
> format.  In fact, 
> > the war did not expand into the file system.
> >
> > So, I removed the context element, and restarted.  With the context 
> > gone, the WAR expanded properly.  Then I added the context back in, 
> > and it worked fine.
> >
> > Is this normal?
> >
> 
> Depends on what you specified for the docBase parameter in 
> the Context element.  This needs to be the absolute or relative (to
> $CATALINA_HOME/webapps) name of the WAR file.
> 
> Craig
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: unpacking of WAR

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 9 Aug 2002, Paul Phillips wrote:

> Date: Fri, 09 Aug 2002 22:49:00 -0500
> From: Paul Phillips <pa...@partitura.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: unpacking of WAR
>
> I worked on deploying my first webapp to another server today.  I packaged
> it up as a war, transferred it to the other tomcat server, added the one
> line context element in the server.xml, and restarted.  Nothing - the logs
> said that the webapp that was referenced by the context statement was not
> available or in a readable format.  In fact, the war did not expand into
> the file system.
>
> So, I removed the context element, and restarted.  With the context gone,
> the WAR expanded properly.  Then I added the context back in, and it worked
> fine.
>
> Is this normal?
>

Depends on what you specified for the docBase parameter in the Context
element.  This needs to be the absolute or relative (to
$CATALINA_HOME/webapps) name of the WAR file.

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


unpacking of WAR

Posted by Paul Phillips <pa...@partitura.com>.
I worked on deploying my first webapp to another server today.  I packaged 
it up as a war, transferred it to the other tomcat server, added the one 
line context element in the server.xml, and restarted.  Nothing - the logs 
said that the webapp that was referenced by the context statement was not 
available or in a readable format.  In fact, the war did not expand into 
the file system.

So, I removed the context element, and restarted.  With the context gone, 
the WAR expanded properly.  Then I added the context back in, and it worked 
fine.

Is this normal?

Thanks
Paul Phillips

PS - the context element in the server.xml is just there to pass in a 
parameter containing the location of a data directory.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>