1 Reply Latest reply on Aug 16, 2010 3:29 AM by Tilman Rossmy

    Fatal Linkage error if multiple threads access the webapp after startup

    Tilman Rossmy Newbie

      Hi all!
      We have a webapp running with Seam/RichFaces in production. Running a performance test with JUnitPerf and HtmlUnit we just found out that if we access the webapp with multiple threads right after it has been started we get this fatal linkage error:

       

      2010-08-13 11:03:26,605 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar!/META-INF/jsf-core.taglib.xml
      2010-08-13 11:03:26,605 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar!/META-INF/jsf-html.taglib.xml
      2010-08-13 11:03:26,621 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar!/META-INF/jsf-ui.taglib.xml
      2010-08-13 11:03:26,637 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar!/META-INF/jstl-core.taglib.xml
      2010-08-13 11:03:26,637 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar!/META-INF/jstl-fn.taglib.xml
      2010-08-13 11:03:26,652 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/seam/jboss-seam-ui/2.1.2/jboss-seam-ui-2.1.2.jar!/META-INF/s.taglib.xml
      2010-08-13 11:03:26,652 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/seam/jboss-seam-pdf/2.1.2/jboss-seam-pdf-2.1.2.jar!/META-INF/seam-pdf.taglib.xml
      2010-08-13 11:03:26,668 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/seam/jboss-seam-excel/2.1.2/jboss-seam-excel-2.1.2.jar!/META-INF/seam-excel.taglib.xml
      2010-08-13 11:03:26,683 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/richfaces/richfaces-ui/3.3.0.GA/richfaces-ui-3.3.0.GA.jar!/META-INF/a4j.taglib.xml
      2010-08-13 11:03:26,683 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/richfaces/richfaces-ui/3.3.0.GA/richfaces-ui-3.3.0.GA.jar!/META-INF/ajax4jsf.taglib.xml
      2010-08-13 11:03:26,683 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/richfaces/richfaces-ui/3.3.0.GA/richfaces-ui-3.3.0.GA.jar!/META-INF/jsp.taglib.xml
      2010-08-13 11:03:26,746 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/richfaces/richfaces-ui/3.3.0.GA/richfaces-ui-3.3.0.GA.jar!/META-INF/rich.taglib.xml
      2010-08-13 11:03:26,746 INFO  - facelets.compiler: Added Library from: jar:file:/c:/.m2/repository/org/jboss/richfaces/richfaces-ui/3.3.0.GA/richfaces-ui-3.3.0.GA.jar!/META-INF/richfaces.taglib.xml
      2010-08-13 11:03:28,119 ERROR - ch.rtc.cyberibis.admin.components.ExceptionsHandler: javax.servlet.ServletException: Servlet execution threw an exception
      2010-08-13 11:03:28,119 ERROR - ch.rtc.cyberibis.admin.components.ExceptionsHandler: org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      ch.rtc.cyberibis.admin.web.servlet.filter.TimingFilter.doFilter(TimingFilter.java:44)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
      org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      java.lang.Thread.run(Thread.java:619)


      2010-08-13 11:03:28,244 ERROR - org.jboss.seam.exception.Exceptions: handled and logged exception
      javax.servlet.ServletException: Servlet execution threw an exception
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at ch.rtc.cyberibis.admin.web.servlet.filter.TimingFilter.doFilter(TimingFilter.java:44)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
          at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
          at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.LinkageError: loader (instance of  org/apache/catalina/loader/WebappClassLoader): attempted  duplicate class definition for name: "org/ajax4jsf/component/RenderPhaseUIDataAdaptorVisitor"
          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:887)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1327)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
          at org.ajax4jsf.util.ServicesUtils.loadClass(ServicesUtils.java:143)
          at org.richfaces.util.RenderPhaseComponentVisitorUtils.init(RenderPhaseComponentVisitorUtils.java:76)
          at org.richfaces.util.RenderPhaseComponentVisitorUtils.getVisitors(RenderPhaseComponentVisitorUtils.java:55)
          at org.richfaces.event.RenderPhaseComponentListener.beforePhase(RenderPhaseComponentListener.java:64)
          at org.ajax4jsf.component.AjaxViewRoot.processPhaseListeners(AjaxViewRoot.java:185)
          at org.ajax4jsf.component.AjaxViewRoot.encodeBegin(AjaxViewRoot.java:502)
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
          at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
          at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
          at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
          at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
          at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
          at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          ... 33 more

       

      On the other hand if we access the webapp with a single thread after startup and then run our performance test, all goes well.

      Any ideas?