5 Replies Latest reply on Jan 6, 2009 3:44 PM by wolfgangknauf

    jtidy.jar causes endless loop

    wolfgangknauf

      Hi to all,

      I try to run my first JSFUnit test with a really simple web app (one JSF, one JSP, all work fine).
      I run into the problem that after adding jtidy-4aug2000r7-dev.jar to WEB-INF\lib (according to the GettingStarted guide), calling the JSF in my app results in some endless loop on the server, resulting in an OutOfMemoryError and a JVM crash.

      My configuration:
      -JBoss 5.0GA
      -JDK 1.6.0_11
      -all JARS from the GettingStarted guide
      -jstl.jar is the only other library in WEB-INF\lib (from "jboss-5.0.0.GA\server\default\deploy\jbossweb.sar").

      I tried to update to a newer JTidy snapshot, but the "snapshot" link at http://jtidy.sourceforge.net/download.html seems to be broken.

      Can anybody help?

      Thanks

      Wolfgang

        • 1. Re: jtidy.jar causes endless loop
          ssilvert

          Hi Wolfgang,

          You should be able to remove JTidy. That is only needed if you are using the pre-Beta3 API. For GA, the old API will be removed completely.

          Regards,

          Stan

          • 2. Re: jtidy.jar causes endless loop
            ssilvert

            BTW, why did you copy jstl.jar to your WAR? You shouldn't need to do that since it is included with JBoss AS5.

            Stan

            • 3. Re: jtidy.jar causes endless loop
              wolfgangknauf

              Hi Stan,

              I use Beta3. I received an error message on running the test if JTidy is missing. More details and a sample will follow soon.

              One question: where can I get a more recent build? On http://hudson.jboss.org/hudson/job/JSFUnit/ I don't find downloads.

              Thanks

              Wolfgang

              • 4. Re: jtidy.jar causes endless loop
                ssilvert

                The latest snapshot build is here: http://snapshots.jboss.org/maven2/org/jboss/jsfunit/

                That build does not include HttpUnit, so it definitely doesn't use JTidy. You can look at WEB-INF/lib of this war to see what is now required:
                http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit-examples-hellojsf-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-examples-hellojsf-jsfunit-1.0.0.GA-20090105.150538-4.war

                Let me know how it goes.

                Stan

                • 5. Re: jtidy.jar causes endless loop
                  wolfgangknauf

                  Hi Stan,

                  thanks a lot, with the most recent build it works like a charm.

                  I had to remove xalan-2.7.0.jar, xercesImpl-2.8.1.jar and xml-apis-1.0.b2.jar, otherwise this resulted in errors:

                  21:21:06,375 ERROR [JBossContextConfig] XML error parsing: context.xml
                  org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
                   at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
                   at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:552)
                   at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:538)
                   at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
                   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
                   at org.apache.catalina.core.StandardContext.init(StandardContext.java:5436)
                   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
                   at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
                   at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
                   at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
                   at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                   at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                  ...
                  Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
                   at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:97)
                   at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:56)
                   at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
                   ... 111 more
                  Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
                   at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
                   at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
                   at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
                   ... 113 more
                  21:21:06,375 ERROR [JBossContextConfig] XML error parsing: jboss.web/localhost/context.xml.default
                  org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
                   at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
                   at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:552)
                   at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:539)
                   at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
                   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
                   at org.apache.catalina.core.StandardContext.init(StandardContext.java:5436)
                  ....
                  Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
                   at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:97)
                   at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:56)
                   at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
                   ... 111 more
                  Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
                   at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
                   at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
                   at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
                   ... 113 more
                  21:21:06,390 ERROR [JBossContextConfig] XML error parsing: WEB-INF/context.xml
                  org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
                   at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
                   at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:552)
                   at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:542)
                   at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
                   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
                   at org.apache.catalina.core.StandardContext.init(StandardContext.java:5436)
                   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
                   at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
                   at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
                   at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
                   at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                   at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  ...
                  Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
                   at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:97)
                   at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:56)
                   at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
                   ... 111 more
                  Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
                   at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
                   at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
                   at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
                   at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
                   ... 113 more
                  21:21:06,406 ERROR [ContextConfig] Marking this application unavailable due to previous error(s)


                  By the way: after removing jstl.jar from my project, the Beta3 JSF once again worked (but after some exceptions with XML parsers I gave up with it). So the endless loop must have been some problem of jstl.jar + jtidy.

                  Thanks for your help!

                  Wolfgang