tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgai...@hotmail.com
Subject Re: java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
Date Sun, 02 Dec 2007 22:28:53 GMT

 Directory of %CATALINA_HOME%\common\lib
06/15/2004  08:29p              26,202 commons-logging-api.jar

 Directory of %CATALINA_HOME%\webapps\EncryptView\WEB-INF\lib
06/15/2004  08:29p              38,015 commons-logging.jar.old
(unusable)

/*lets create a jsp page which will call into that jar..*/
<%@ page contentType="text/html;charset=windows-1252"
import="org.apache.commons.logging.*" %>

later on in the index.jsp attempt to use the log
line 42 onMouseUp="<%log.debug("From index.jsp StringToEncrypt=");

An error occurred at line: 42 in the jsp file: /index.jsp
Generated servlet error:
log cannot be resolved (but commons-logging.jar IS located in
%CATALINA_HOME%\common\lib) so why did'nt the classloader find it?

lets re-enable commons-logging
%CATALINA_HOME%\webapps\EncryptView\WEB-INF\lib>ren *.jar.old *.jar
commons-logging.jar is now enables in
%CATALINA_HOME%\webapps\EncryptView\WEB-INF\lib

so commons-logging.jar in %CATALINA_HOME%\common\lib was completely missed
by the classloader but demand-loaded when placed in webappName\WEB-INF\lib

Is there a misconfig that I dont know about?
Environment:
TOMCAT 5.5.17
java version "1.5.0_02"

Martin







----- Original Message -----
Wrom: WIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGS
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Sunday, December 02, 2007 12:24 PM
Subject: RE: java.lang.NoClassDefFoundError:
org/apache/commons/collections/SequencedHashMap


> Wrom: WZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFD
> Subject: Re: java.lang.NoClassDefFoundError:
> org/apache/commons/collections/SequencedHashMap
>
> Common/lib is for internal use and wouldnt be expected to
> demand load the classes you require as is the case for the
> webapp WEB-INF
> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Although the reference given is quite appropriate, the statements
preceding it are incorrect.

The common/lib location is not for Tomcat internal use; it provides a
location for classes that must be visible to *both* Tomcat and webapps,
such as the servlet API interfaces and JDBC drivers for connection
pooling.

And, of course, all classes are "demand loaded" on first reference,
regardless of location.

Placing application-specific classes in WEB-INF/lib is certainly the
right thing to do, since that contributes to webapp independence.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message