I had planned on using (and have always used) the standard
WEB-INF/classes and WEB-INF/lib directories in war files for deployment.
I am only looking at where Tomcat will pull classes and libraries during
development.  

In the past, we had our Ant tasks set up to compile everything then jar
up sub modules and copy the new jars along with newly compiled classes
to the WEB-INF/classes and WEB-INF/lib directories, so I know it is
fairly trivial.  However, when Resin allowed us to configure the
classloader we found that the extra couple seconds that were saved by
not adding the extra jar and copy steps and especially the several
seconds that were saved by just using the IDE's internal compiler and
not firing up Ant at all made a huge difference in our development
efficiency by helping to preserve the code-compile-test rhythm.  

It sounds like a custom classloader is the only option available.  Any
pointers on how best to implement one?

Nathan

-----Original Message-----
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 29, 2004 11:44 AM
To: Tomcat Users List
Subject: RE: Alternate class and lib directories


Hi,
By the way, to clarify a point: I wasn't saying you should change your
CVS organization or build process, just the deployment.  It'd be fairly
trivial to write an Ant task to create a WAR for each module from your
directory structure: deploy that WAR and you're golden.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Shapira, Yoav
>Sent: Wednesday, September 29, 2004 12:40 PM
>To: Tomcat Users List
>Subject: RE: Alternate class and lib directories
>
>
>Hi,
>In Tomcat, the location of the classes and libraries for your web 
>application is not configurable.  You have a choice of several 
>repositories, as explained in the Classloader How-To 
>(http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.htm
l
>).  These are not limited to WEB-INF/classes or WEB-INF/lib: you can
use
>the common or shared repositories as well.
>
>In addition, as you've noted, you can use custom classloaders with 
>Tomcat which will load classes from wherever and however you want.
>
>But IMHO, it'd be a waste of time on your behalf and the result would
be
>mediocre if you choose to stick with your current approach.  Instead, 
>deploy according to the Servlet Specification (even while in 
>development), and put all your classes and libs in WEB-INF/classes and 
>WEB-INF/lib respectively.  You'll save time and effort, and gain
>portability: exactly what you lost when you relied on Resin's 
>proprietary classloading hook.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-----Original Message-----
>>From: Nathan Voxland [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, September 29, 2004 12:27 PM
>>To: [EMAIL PROTECTED]
>>Subject: Alternate class and lib directories
>>
>>We are attempting to move our existing development environment from 
>>Resin to Tomcat, but I am having difficulties getting our build 
>>environment to work with Tomcat.
>>
>>We have many project going on a the same time, most consisting of 
>>multiple CVS modules set up where the main module depends on a 
>>sub-module which depends on a sub-module etc.  For example:
>>
>>moduleRoot/src/java
>>moduleRoot/src/java-test
>>moduleRoot/src/root/web    <-- document root
>>moduleRoot/build               <-- where classes are compiled to for
>>this module
>>moduleRoot/build-test
>>moduleRoot/lib                   <-- where all the required .jar files
>>go
>>
>>subModuleRoot/src/java
>>subModuleRoot/src/java-test
>>subModuleRoot/src/build    <-- where classes are compiled to for this
>>module
>>subModuleRoot/src/build-test
>>
>>We have our IDE's set to compile to the build directory and our ant 
>>tasks that do things like JDO enhancing and our automated build system

>>work with this directory structure.
>>
>>My problem is that Tomcat expects classes to be in WEB-INF/classes and

>>jars in WEB-INF/lib, not where we have them.  Resin gives you the 
>>ability to configure your class loader like this:
>>
>>        <class-loader>
>>            <simple-loader path="/cvs/moduleRoot/build"/>
>>            <simple-loader path="/cvs/subModuleRoot/build""/>
>>            <library-loader path="/cvs/moduleRoot/lib""/>
>>        </class-loader>
>>
>>but I can't find anything similar in Tomcat.
>>
>>I have been trying to overload and/or re-implement WebappLoader and 
>>WebappClassLoader but have been having no luck.  I know tomcat is 
>>running my Loaders because the debug info I add gets printed out, but
I
>>continue to get ClassNotFoundExceptions when on the filters and
context
>>listeners I have set up in my web.xml.
>>
>>I've mainly been focusing on trying to call addRepository in 
>>WebappClassLoader passing in moduleRoot/build, subModuleRoot/build,
and
>>moduleRoot/lib, but that doesn't seem to be helping.  I also tried 
>>completely re-implementing WebappLoader starting with the original
>code,
>>but I haven't been able to get that to work yet, plus I don't like 
>>having to duplicate so much code when I feel I should be just
extending
>>existing classes.
>>
>>Can anyone give me a direction to look, or point me to some 
>>configuration info I have missed?
>>
>>Thanks,
>>Nathan
>
>
>
>This e-mail, including any attachments, is a confidential business 
>communication, and may contain information that is confidential, 
>proprietary and/or privileged.  This e-mail is intended only for the
>individual(s) to whom it is addressed, and may not be saved, copied, 
>printed, disclosed or used by anyone else.  If you are not the(an)
intended
>recipient, please immediately delete this e-mail from your computer
system
>and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.


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


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

Reply via email to