You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Craig S. Connell" <CS...@datinc.com> on 2003/01/13 19:12:41 UTC

setting unpackWars=false

This afternoon I began to look at running some of our WAR files in
Tomcat (4.0.4) without unpacking them.  I set the unpackWars=false in
server.xml.

This seems pretty straightforward, although there appear to be some
issues.  None of the application that I try to run this way work now.
  These applications do work if I set unpackWars=true.

An example is Cocoon.  When I try and run Cocoon without unpacking it, I
get some errors in Cocoon where it appears unable to find some of the
classes it requires.  If I look into the work directory, I find that
some files have been unpacked there (as I expected), and notice that the
classes in question actually do exist in a JAR in the WEB_INF\lib
directory (as expected).  So, in Cocoon's case, I am unable to compile
the sitemap_xmap.java file.

So my question is .... what am I missing?  Are there some other
configurable options that I should be aware of?  What do I need to do to
make an application run without unpacking the WAR file?  I also noticed
that the contents of the work directory are different depending on
whether or not unpackWars is true of false.  I could see that being
expected behavior - but should it be?

Thanks for any help.

Craig S. Connell



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


Re: setting unpackWars=false

Posted by Jacob Kjome <ho...@visi.com>.
Hello Craig,

One thing to watch out for when running an app directly from a .war
file is that if the application is trying to do any File IO where it
tries to load resources existing within the WAR structure, it won't
work if the .war is not expanded into a directory.  I've noticed
various frameworks that ignore this and continue to use File IO.
These apps *will* break.  See if you are getting any stack traces in
Tomcat's log files.  You might want to turn Tomcat's debugging level
up and check if any of these problems exist.

Jake

Monday, January 13, 2003, 12:12:41 PM, you wrote:

CSC> This afternoon I began to look at running some of our WAR files in
CSC> Tomcat (4.0.4) without unpacking them.  I set the unpackWars=false in
CSC> server.xml.

CSC> This seems pretty straightforward, although there appear to be some
CSC> issues.  None of the application that I try to run this way work now.
CSC>   These applications do work if I set unpackWars=true.

CSC> An example is Cocoon.  When I try and run Cocoon without unpacking it, I
CSC> get some errors in Cocoon where it appears unable to find some of the
CSC> classes it requires.  If I look into the work directory, I find that
CSC> some files have been unpacked there (as I expected), and notice that the
CSC> classes in question actually do exist in a JAR in the WEB_INF\lib
CSC> directory (as expected).  So, in Cocoon's case, I am unable to compile
CSC> the sitemap_xmap.java file.

CSC> So my question is .... what am I missing?  Are there some other
CSC> configurable options that I should be aware of?  What do I need to do to
CSC> make an application run without unpacking the WAR file?  I also noticed
CSC> that the contents of the work directory are different depending on
CSC> whether or not unpackWars is true of false.  I could see that being
CSC> expected behavior - but should it be?

CSC> Thanks for any help.

CSC> Craig S. Connell



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



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


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


Re: setting unpackWars=false

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

On Mon, 13 Jan 2003, Craig S. Connell wrote:

> Date: Mon, 13 Jan 2003 13:12:41 -0500
> From: Craig S. Connell <CS...@datinc.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: setting unpackWars=false
>
> This afternoon I began to look at running some of our WAR files in
> Tomcat (4.0.4) without unpacking them.  I set the unpackWars=false in
> server.xml.
>
> This seems pretty straightforward, although there appear to be some
> issues.  None of the application that I try to run this way work now.
>   These applications do work if I set unpackWars=true.
>
> An example is Cocoon.  When I try and run Cocoon without unpacking it, I
> get some errors in Cocoon where it appears unable to find some of the
> classes it requires.  If I look into the work directory, I find that
> some files have been unpacked there (as I expected), and notice that the
> classes in question actually do exist in a JAR in the WEB_INF\lib
> directory (as expected).  So, in Cocoon's case, I am unable to compile
> the sitemap_xmap.java file.
>
> So my question is .... what am I missing?  Are there some other
> configurable options that I should be aware of?  What do I need to do to
> make an application run without unpacking the WAR file?  I also noticed
> that the contents of the work directory are different depending on
> whether or not unpackWars is true of false.  I could see that being
> expected behavior - but should it be?
>

The webapp itself has to be written so that it can work inside a WAR.

Most commonly, that means using ServletContext.getResource() or
ServletContext.getResourceAsStream() instead of file i/o in order to read
webapp resources.  You also cannot write to resources in a WAR (which I
suspect Cocoon probably tries to do).

> Thanks for any help.
>
> Craig S. Connell
>

Craig


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