tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44041] WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true
Date Tue, 12 May 2009 15:59:00 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44041





--- Comment #9 from Richard George <rcgeorge23@gmail.com>  2009-05-12 08:58:56 PST ---
(In reply to comment #8)

Hi,

We also experienced this issue while using the Sysdeo plugin with DevLoader. It
was resolved (for us) by synchronizing WebappClassLoader.loadClass.

Cheers.

> Are you sure it is OK to synchronize around the call to
> URLClassLoader.findClass?
> 
> If you have a page with 2 frames, each loading a JSP at the same time:
> 
> Thread T1 tries to load my.class.Foo
> Thread T2 tries to load my.class.Foo
> 
> T1 calls WebappClassLoader.loadClass
> T2 calls WebappClassLoader.loadClass
> 
> WebappClassLoader determines it has not loaded the class for both threads
> (since there is no synchronization at this point).
> 
> Both T1 and T2 get to the synchronized block in findClass.
> They get synchronized, but doing the wrong thing, and a LinkageError gets
> thrown.
> 
> Don't you think that WebappClassLoader.loadClass(String, boolean) ought to be
> synchronized just like it is in java.lang.ClassLoader?
> 
> I am actually running into this problem with Tomcat 5.5.27 (on a 4 core
> machine):
> 
> Caused by: java.lang.LinkageError: loader (instance of 
> org/apache/catalina/loader/WebappClassLoader): attempted  duplicate class
> definition for name: "org/apache/struts/taglib/tiles/PutTag"
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>     at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>     at
> org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:904)
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1353)
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
>     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:125)
>     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) 
> .... etc ....

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message