tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve McWilliams" <smcwilli...@EmprisaNetworks.com>
Subject Loading classes from a WAR file outside of Tomcat
Date Thu, 26 Aug 2004 18:19:01 GMT
Hello,

I am wondering if anyone can suggest an easy way to reuse WAR files
outside of Tomcat.  We use Tomcat 5.0.27 and deliver out application
bundled up in a WAR file, which we do not explode at runtime.

Ideally I would like to be able to reuse some of the classes in our WAR
file from a stand alone java application outside of Tomcat (that does some
administrative tasks and gets called by InstallShield at installation
time).  I would rather not have to explode the WAR file to do this.

I would like to be able to do something like this in my stand alone java
code, in order to find the class in the WAR file:

WARClassLoader loader = new WARClassLoader();
loader.addWAR(warFileAbsolutePath);
Class clazz = Class.forName(desiredClass, true, loader);

I could write my own WARClassLoader, but it seems like such a thing must
already exist.  I poked around through the Tomcat source but everything
seems to be snarled up in the Container and DirContext overhead somehow. 
I also looked at the Tomcat WebappLoader, StandardClassLoader, and
WebappClassLoader but none of those look like they can read into a WAR
file.

Thanks in advance.

Steve McWilliams
Software Engineer
Emprisa Networks
703-691-0433x21
smcwilliams@emprisanetworks.com

The information contained in this communication is intended only for the
use of the recipient named above, and may be legally privileged,
confidential and exempt from disclosure under applicable law. If the
reader of this communication is not the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication, or any of its contents, is strictly prohibited. If you have
received this communication in error, please resend this communication to
the sender and delete the original communication and any copy of it from
your computer system. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message