Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Determining the complete classpath for a web app in Tomcat 5.5

Rutherford, Michael

2007-02-23

Replies:

I am attempting to find a (preferably simple :-) way to find out the
complete classpath for a web app.



I can use the System property "java.class.path" which returns a list of
the jars and dirs from the system classpath, along with the common lib
and classes and the shared lib and classes. It does not however list the
jars found in the WEB-INF\lib directory.



One potential solution would be to deploy all classes/jars to the common
library but that idea gives me hives. Another solution would be to
determine the classes/jars using file scanning which isn't much better.
I don't want to go with a solution that requires separate maintenance to
continue working so I don't want to add a property file or similar.
Overriding the class loaders to provide the required detail is doable
but I don't want to change the underlying Tomcat code (maybe I can use
reflection to access a private variable or something, which is still not
good but is better than changing Tomcat at least).



Michael Rutherfurd


************** IMPORTANT MESSAGE *****************************    
This e-mail message is intended only for the addressee(s) and contains information which may be
confidential.
If you are not the intended recipient please advise the sender by return email, do not use or
disclose the contents, and delete the message and any attachments from your system. Unless
specifically indicated, this email does not constitute formal advice or commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries.
We can be contacted through our web site: commbank.com.au.
If you no longer wish to receive commercial electronic messages from us, please reply to this
e-mail by typing Unsubscribe in the subject line.
**************************************************************


©2008 junlu.com - Jax Systems, LLC, U.S.A.