7 Replies Latest reply on May 28, 2010 8:42 AM by Andrew Huser

    JSFUnit with jsf 2.0 (can't find org.apache.xml.utils.PrefixResolver)

    Andrew Huser Newbie

      I have taken the tomcat6.0 example and changed the faces-config to version 2.0, and made a new index.xhtml file along with replacing the 1.2 jsf jars with the 2.0 jars (Mojarra 2.0.2-FC5) along with the JSFUnit.1.2.0Final jar.  When running the tests, I get the following NoClassDefFoundError for org/apache/xml/utils/PrefixResolver.  But I have xalan-2.7.0.jar in my WEB-INF/lib (exactly as the tomcat example war has it).  xercesImpl-2.8.1.jar is also there.  I am using java6 and tomcat 6.

       

      Does JSFUnit (or httpunit or anything else under it) do some weird classloading that is making this occur?

       

      Is this related to using xhtml?

       

      Does anyone have any other suggestions?

       

      Is there a JSF 2.0 sample project?  I didn't see one anywhere.

       

       

      org/apache/xml/utils/PrefixResolverjava.lang.NoClassDefFoundError:  org/apache/xml/utils/PrefixResolver
      at  com.gargoylesoftware.htmlunit.html.DomNamespaceNode.getLocalName(DomNamespaceNode.java:80)
      at  com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:561)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown  Source)
      at  com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:523)
      at  org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:210)
      at  org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
      at  org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:993)
      at  org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:896)
      at  org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:3057)
      at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:893)
      at  org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:495)
      at  org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:448)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at  com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:771)
      at  com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252)
      at  com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:127)
      at  com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
      at  com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:439)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:327)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:384)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369)
      at  org.jboss.jsfunit.framework.SimpleInitialRequestStrategy.doInitialRequest(SimpleInitialRequestStrategy.java:48)
      at  org.jboss.jsfunit.framework.WebClientSpec.doInitialRequest(WebClientSpec.java:244)
      at  org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:80)
      at  org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:57)
      at  org.jboss.jsfunit.jsfsession.hellojsf.SimplifiedHelloJSFIntegrationTest.setUp(SimplifiedHelloJSFIntegrationTest.java:87)
      at  org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
      at  org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
      at  org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
      at  org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
      at  org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
      at  org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
      at  org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:224)
      at  org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
      at  org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:46)
      at  org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
      at  org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
      at  org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
      at  org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at  org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:116)
      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:263)
      at  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
      at  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)
      Caused by:  java.lang.ClassNotFoundException: org.apache.xml.utils.PrefixResolver
      at  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
      at  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
      ... 58 more