On Sat, Jan 31, 2009 at 8:38 AM, Dale Newfield <d...@newfield.org> wrote:
> David Erickson wrote:
>>
>> java.lang.LinkageError: loader (instance of
>> org/apache/catalina/loader/WebappClassLoader): attempted  duplicate
>> class definition for name: "com/x/y/ZAction"
>
> I believe this error is thrown when there's more than one version of the
> .class available in the classpath.  Are you sure that you don't have more
> than one .jar in your WEB-INF/lib that defines more than one version of this
> class?  I'd guess that there was an undeployment issue and not all the jars
> got removed before redeploying the new war.  When upgrading to 2.1.6 I had
> to delete the whole deployment directory when the app server was off in
> order to clean out the old .jars.
>
> -Dale

Thanks for the reply Dale. I verified everywhere that there was only
one copy of the class file. I am deploying it in Eclipse 3.3.2, Tomcat
6.0.16. I narrowed it down to being a problem when you are using the
Eclipse to deploy in place (versus another folder), which is accessed
by double clicking the server in the servers tab and under server
options clicking "serve modules without publishing". The problem does
not exist when deployed to another folder, and the only difference
that I can find is that when its in place Eclipse is specifying the
classloader "org.eclipse.jst.server.tomcat.loader.WtpWebappLoader"
(which I could not find source or even binary to anywhere.. I swear it
doesnt exist). I tried with Eclipse 3.4.1, same problems. I then
rolled back my local libraries to the previous struts 2.0.11.1 and the
problem again disappeared. I am convinced it is a synchronization race
condition because if I turn on debug logging, or debug walk it by hand
the problem goes away. Also after the first exception for the class, I
get no further exceptions (it has been placed in the cache).

Thoughts or ideas greatly appreciated..

Thanks,
David

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to