3 Replies Latest reply on Feb 9, 2011 3:14 PM by Chris Dollar

    JB6 + JSF1.2 class loader or config problem?

    Chris Dollar Novice

      Hi All,

       

      I'm migrating an application from JB 4.2 to JB6 and have noticed some issues using Mojarra 1.2 and facelets.

       

      I deploy my app as an .ear archive, and it contains (among other things) 3 different war files. Each .war file uses facelets, and each one declares a .taglib.xml file.  The application deploys just fine to JBoss.

       

      The problem I'm seeing is when I go to the context mapped by B.war for the first time it parses the facelets tags, but it is also parsing the .taglib.xml file from A.war and C.war. The taglib for A.war uses a <handler-class> for one of its tags, and this causes an error to be thrown by B.war since the class specified isn't contained in its classpath. If I change the build for B.war to include the class being called in A.war's taglib things work just fine with no errors.

       

      Here is the error I see when I visit the context of B.war:

       

      {code}

      11:15:33,092 SEVERE [facelets.compiler] Error Loading Library: vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/tags/PermitExpress.taglib.xml: java.io.IOException: Error parsing [vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/tags/PermitExpress.taglib.xml]:

              at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410) [:1.1.15.B1]

              at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:431) [:1.1.15.B1]

              at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:87) [:1.1.15.B1]

              at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:100) [:1.1.15.B1]

              at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:517) [:1.1.15.B1]

              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567) [:1.1.15.B1]

              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100) [:3.3.3.Final]

              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176) [:3.3.3.Final]

              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:1.2_15-20100816-SNAPSHOT]

              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) [:1.2_15-20100816-SNAPSHOT]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]

              at com.rydindecal.PEClientWeb.web.servlets.PortalServlet.doAction(PortalServlet.java:185) [:]

              at com.rydindecal.PEClientWeb.web.servlets.PortalServlet.doGet(PortalServlet.java:60) [:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [:1.0.0.Final]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]

              at com.rydindecal.PEClientWeb.web.filters.ClientNameRewriterFilter.doFilter(ClientNameRewriterFilter.java:127) [:]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]

              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:593) [:6.0.0.Final]

              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]

              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]

              at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]

              at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:504) [:6.0.0.Final]

              at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:437) [:6.0.0.Final]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]

              at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]

      Caused by: org.xml.sax.SAXException: Error Handling [vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/tags/PermitExpress.taglib.xml@136,92] <handler-class>

              at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:271) [:1.1.15.B1]

              at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at javax.xml.parsers.SAXParser.parse(SAXParser.java:195) [:1.6.0_18]

              at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:407) [:1.1.15.B1]

              ... 49 more

      {code}

       

      A.war is "PermitExpress.war", and B.war is "PEMobileWeb.war". From the above you can see when I visit the B.war context it is parsing the taglib from A.war.

       

      Additionally, both A.war and B.war use Richfaces, while C.war doesn't. However, when I visit the context of C.war for the first time it gives errors trying to parse all the RF and A4J taglibs:

       

      {code}

      11:13:06,068 SEVERE [facelets.compiler] Error Loading Library: vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/lib/richfaces-ui-3.3.3.Rydin.jar/META-INF/jsp.taglib.xml: java.io.IOException: Error parsing [vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/lib/richfaces-ui-3.3.3.Rydin.jar/META-INF/jsp.taglib.xml]:

              at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410) [:1.1.15.B1]

              at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:431) [:1.1.15.B1]

              at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:87) [:1.1.15.B1]

              at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:100) [:1.1.15.B1]

              at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:517) [:1.1.15.B1]

              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567) [:1.1.15.B1]

              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) [:1.2_15-20100816-SNAPSHOT]

              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:1.2_15-20100816-SNAPSHOT]

              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) [:1.2_15-20100816-SNAPSHOT]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]

              at com.rydindecal.PEClientWeb.web.servlets.PortalServlet.doAction(PortalServlet.java:185) [:]

              at com.rydindecal.PEClientWeb.web.servlets.PortalServlet.doGet(PortalServlet.java:60) [:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [:1.0.0.Final]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]

              at com.rydindecal.PEClientWeb.web.filters.ClientNameRewriterFilter.doFilter(ClientNameRewriterFilter.java:127) [:]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]

              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:593) [:6.0.0.Final]

              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]

              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]

              at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]

              at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:504) [:6.0.0.Final]

              at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:437) [:6.0.0.Final]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]

              at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]

      Caused by: org.xml.sax.SAXException: Error Handling [vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/lib/richfaces-ui-3.3.3.Rydin.jar/META-INF/jsp.taglib.xml@11,18] <handler-class>

              at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:271) [:1.1.15.B1]

              at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]

              at javax.xml.parsers.SAXParser.parse(SAXParser.java:195) [:1.6.0_18]

              at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:407) [:1.1.15.B1]

              ... 47 more

       

       

      11:13:06,072 SEVERE [facelets.compiler] Error Loading Library: vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/lib/richfaces-ui-3.3.3.Rydin.jar/META-INF/ajax4jsf.taglib.xml: java.io.IOException: Error parsing [vfs:/home/chris/java/projects/jboss-6.0.0.Final.git/server/permitexpress/farm/PermitExpress.ear/PermitExpress.war/WEB-INF/lib/richfaces-ui-3.3.3.Rydin.jar/META-INF/ajax4jsf.taglib.xml]:

              at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410) [:1.1.15.B1]

              at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:431) [:1.1.15.B1]

              at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:87) [:1.1.15.B1]

              at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149) [:1.1.15.B1]

              at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:100) [:1.1.15.B1]

      .... {code}

       

      As with B.war, in the case of C.war if I update the build to include the richfaces jar files in WEB-INF/lib for C.war then I dont' get the errors, but this is a bit ridiculous since C.war doesn't use richfaces.

       

      I should also note that although I get these errors in the log files everything seems to work just fine, it just clutters up my logs.

       

      So I'm not sure if this is due to a problem with my configuration or if it is a class loading issue with the JSF deployer? I've tried changing the classloader isolation value in JBOSS_HOME/server/<server>/deployers/ear-deployer-jboss-beans.xml but changing that value has no effect.

       

      Can anyone tell me what is wrong here?

       

      Thanks in advance!

      Chris