You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2007/12/07 22:55:58 UTC

DO NOT REPLY [Bug 44041] New: - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041

           Summary: WebappClassLoader duplicate class definition under high
                    Load if hasExternalRepositories is true
           Product: Tomcat 5
           Version: 5.5.25
          Platform: All
               URL: http://www.ubik-ingenierie.com
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: p.mouawad@ubik-ingenierie.com


I am using Tomcat Sysdeo Plugin combined with their DevLoader.
This class extends Tomcat WebappClassLoader to add external repositories through:
WebappClassLoader#addRepository

Under high load this exception occurs if a Servlet or JSP calls:
			Class clazz =
Thread.currentThread().getContextClassLoader().loadClass("<Class Name>");


java.lang.LinkageError: duplicate class definition:
com/ubikingenierie/bug/ClassLoadedDynamically
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
	at java.net.URLClassLoader.access$100(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:890)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
	at com.ubikingenierie.servlet.BasicServlet.service(BasicServlet.java:27)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:544)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:595)


Philippe.
http://www.ubik-ingenierie.com

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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041





------- Additional Comments From p.mouawad@ubik-ingenierie.com  2007-12-07 14:07 -------
I just forgot one thing:
You have to unpack DevLoader.zip in TOMCAT5_HOME/server/classes to make the
DevLoader available to Tomcat.
See:
http://www.eclipsetotale.com/tomcatPlugin.html
And inside plugin see DevLoader.zip

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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041





------- Additional Comments From p.mouawad@ubik-ingenierie.com  2007-12-07 14:05 -------
Created an attachment (id=21246)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21246&action=view)
Tomcat Sysdeo DevLoader Last version

You can get this from:
http://www.eclipsetotale.com/tomcatPlugin.html

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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041





------- Additional Comments From markt@apache.org  2007-12-10 14:28 -------
Thanks for the test case. I was able to reproduce this. A sync is required to
fix it but a much smaller one than proposed.

I have fixed trunk and proposed the fix for backport to 6.0.x and 5.5.x

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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041





------- Additional Comments From p.mouawad@ubik-ingenierie.com  2007-12-07 14:04 -------
Created an attachment (id=21245)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21245&action=view)
The dependent project that will be added by DevLoader as an externalrepository

See previous patch.
You just have to import in in the same Eclipse workspace as a project called
DependentProject 

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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041


Tim.Whittington@orionhealth.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|Tim.Whittington@orionhealth.|
                   |com                         |




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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041





------- Additional Comments From p.mouawad@ubik-ingenierie.com  2007-12-07 14:02 -------
Created an attachment (id=21244)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21244&action=view)
Sample Project that contains the Servlet and a Test case

This project uses Tomcat Sysdeo DevLoader.
TO use it, import the project DependentProject (next attachment) in Eclipse.
TO use it, import the project BugTomcat5 in Eclipse.
Define classpath variable LIBRARIES that points to a folder containing:
-commons-codec-1.3.jar
-commons-httpclient-3.1.jar
-commons-logging-1.0.4.jar
-junit-3.8.jar
-junitperf-1.8.jar
-log4j-1.2.15.jar
Reference the config\server-j2ee14.xml as Tomcat config file
Start tomcat
Run com.ubikingenierie.client.MultiThreadedTestClientSuite


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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041


Tim.Whittington@orionhealth.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Tim.Whittington@orionhealth.
                   |                            |com




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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041





------- Additional Comments From p.mouawad@ubik-ingenierie.com  2007-12-07 14:22 -------
Their is a solution, add synchronized to loadClass(String name, boolean resolve)
line 1238, but it is maybe an important contention point for you:
public synchronized Class loadClass(String name, boolean resolve)

Although note that java.lang.ClassLoader has a synchronized method:
    protected synchronized Class<?> loadClass(String name, boolean resolve)

Philippe.

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

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


DO NOT REPLY [Bug 44041] - WebappClassLoader duplicate class definition under high Load if hasExternalRepositories is true

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44041>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44041


markt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From markt@apache.org  2008-01-06 15:19 -------
Fixed in 5.5.x and will be included in 5.5.26 onwards.
Fixed in 6.0.x and will be included in 6.0.16 onwards.

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

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