I pressed send too quickly.

How can it be that most of the time Tomcat starts, and sometimes it spits
out the ClassNotFound error? I suppose that the classloading order does not
change from day to day?

2009/10/3 Bocalinda <bocali...@gmail.com>

> Hi Chuck,
>
> That's a good point. First thing in the morning I will check out.
>
> I know the basics of the Tomcat classloading principle. However, I'm trying
> to imagine myself the situation where a duplication of a class leads to an
> ClassNotFound error (It's quite ironic honestly :))
>
> If I'm not wrong Tomcat loads it classes in the following order:
>
> 1. bootstrap
> 2. classpath classes
> 3. webapps classes/libs
> 4. common libs
> 5. shared libs
>
> Let's say that my webapp uses a class that is both placed in web-inf/lib
> and common/lib. According to the classloading order, the class that is in my
> web-inf/lib should be loaded first. In which case I don't understand why my
> webapp complains that it can't find the class...
>
> The only thing I can think of is that my webapp's classloader loads class X
> from web-inf/lib, and that this class is used by some other class in
> common/lib.
>
> Although, I don't think this is the case in my situation. Spring is only
> used inside my webapp.
>
> I'm probably overseeing something basic here, and would really appreciate
> it if somebody could point me out what it is.
>
> Thanks
>
> 2009/10/2 Caldarale, Charles R <chuck.caldar...@unisys.com>
>
> > From: Bocalinda [mailto:bocali...@gmail.com]
>> > Subject: Re: Connection between ListenerStart and clustering
>> >
>> > The class mentioned is actually there....
>> > java.lang.NoClassDefFoundError:
>> > org/springframework/web/context/ContextLoaderListener
>>
>> Is the class perhaps in too many places?  It must not appear in more than
>> one location in any given branch of the classloader tree.  For example, you
>> must not place the class in both Tomcat's lib directory and the webapp's
>> WEB-INF/lib directory - it has to be one or the other.
>>
>>  - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>

Reply via email to