You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Quaini Michele <mi...@fastweb.it> on 2000/10/24 11:46:16 UTC

more than one apps

Hello to the list,
I have two questions:

1) We have to deploy another application based on the framework Struts

Is it safe to put struts.jar under the path webapps/application2/WEB-INF/lib
and struts.tld under the path webapps/application2/WEB-INF ?

Will not TOMCAT have problems having two jars with the same classes?
If yes, where should I put the jars in case of more than one application, in
the directory
$TOMCAT_HOME/libs?


2) We have some log messages that goes in servlet.log (for instance, the
Actions servlets ones) 
and some of them on the console.

We would like to have all the messages going to a unique log as now we
cannot reconstruct the flow of the application

Do you have any suggestion?

Many thanks

Michele


Re: more than one apps

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Quaini Michele wrote:

> Hello to the list,
> I have two questions:
>
> 1) We have to deploy another application based on the framework Struts
>
> Is it safe to put struts.jar under the path webapps/application2/WEB-INF/lib
> and struts.tld under the path webapps/application2/WEB-INF ?
>

Yes, this is the recommended approach.  The classes under WEB-INF/lib for each
web application are totally independent of each other, even if they have the
same names.

>
> Will not TOMCAT have problems having two jars with the same classes?
> If yes, where should I put the jars in case of more than one application, in
> the directory
> $TOMCAT_HOME/libs?

Actually, putting struts.jar on the classpath (or in $TOMCAT_HOME/libs) will
cause it not to work.  The problem happens when Struts tries to create a new
application object like an ActionForm bean, and you've got the bean itself under
WEB-INF/classes or WEB-INF/lib.  Because of the way that class loaders work, a
copy of Struts on the system class path will be unable to locate the
corresponding class, and you will get ClassNotFoundException errors.

>
> 2) We have some log messages that goes in servlet.log (for instance, the
> Actions servlets ones)
> and some of them on the console.
>
> We would like to have all the messages going to a unique log as now we
> cannot reconstruct the flow of the application
>
> Do you have any suggestion?
>

There is a restriction in Tomcat 3.2 related to how you declare log files.  In
Tomcat 4.0 this has been enhanced, letting you declare a separate destination
for the servlet log per application, instead of globally.

If you need to run under Tomcat 3.2, I suggest that you add some sort of
application identifier to the log messages being created.  A common pattern that
I use creates log files like this:

[Application1] This event happened
[Application2] That other event happened

>
> Many thanks
>
> Michele

Craig McClanahan

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat