1 2 Previous Next 21 Replies Latest reply on Aug 30, 2010 4:56 PM by ssilvert Go to original post
      • 15. Re: 500 Internal Server Error
        ssilvert

        Nadine Abdel Hamid wrote:

         

        What makes it interpret or recognizes index.jsfunit?

        JSFUnit 1.2 and 1.3 have web-fragment.xml and a ServletContainerInitializer.  If you are using this on Servlet 3.0  (Glassfish 3, JBoss AS6, Tomcat 7), then the mappings from web-fragment.xml will be added to your applicaiton.  In addition to the usual JSFUnit mappings, the mappings also contain the following for the JSFUnit Console:

         

           <servlet>
              <servlet-name>JSFUnit Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            </servlet>

         

           <servlet-mapping>
              <servlet-name>JSFUnit Faces Servlet</servlet-name>
              <url-pattern>*.jsfunit</url-pattern>
           </servlet-mapping>

         

           <welcome-file-list>
              <welcome-file>jsfunit/index.html</welcome-file>
           </welcome-file-list>

         

         

         

        The ServletContainerInitializer is the thing that discovers all of your test classes that extend ServletTestCase.  Then it makes URLs for each one so it can be displayed in the console.

         

        Stan

        • 16. Re: 500 Internal Server Error
          ssilvert
          • 17. Re: 500 Internal Server Error
            user_00

            Yahya, can you please send me your war file and the exact jars that are placed in your domain lib directory

            • 18. Re: 500 Internal Server Error
              user_00

              OK i placed

                 <servlet>
                    <servlet-name>JSFUnit Faces Servlet</servlet-name>
                    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                  </servlet>

               

                 <servlet-mapping>
                    <servlet-name>JSFUnit Faces Servlet</servlet-name>
                    <url-pattern>*.jsfunit</url-pattern>
                 </servlet-mapping>

               

              in my web.xml and it worked!

               

              I clicked on the run all tests, it gave 404 error code

               

              I placed the ServletTestRunner, ServletRedirector definitions in the web.xml, and now the run all tests link works and goes to

              http://localhost:8080/testJsfunit/ServletTestRunner?suite=org.jboss.jsfunit.init.AllJSFUnitTests&xsl=jsfunit%2Fcactus-report.xsl

               

              and gives me

              Error loading stylesheet: Parsing an XSLT stylesheet failed.

               

              I adjust the URL to be http://localhost:8080/testJsfunit/ServletTestRunner?suite=org.jboss.jsfunit.init.AllJSFUnitTests&xsl=cactus-report.xsl

              and placed cactus-report.xsl in my WebContent some tests run successfuly and others throw exception

               

              org.jboss.jsfunit.framework.JSFUnitWebConnection.getResponse(Lcom/gargoylesoftware/htmlunit/WebRequestSettings;)Lcom/gargoylesoftware/htmlunit/WebResponse;java.lang.AbstractMethodError:   org.jboss.jsfunit.framework.JSFUnitWebConnection.getResponse(Lcom/gargoylesoftware/htmlunit/WebRequestSettings;)Lcom/gargoylesoftware/htmlunit/WebResponse;
              at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1430)
              at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1388)
              at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:325)
              at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386)
              at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:371)
              at org.jboss.jsfunit.framework.SimpleInitialRequestStrategy.doInitialRequest(SimpleInitialRequestStrategy.java:48)
              at org.jboss.jsfunit.framework.WebClientSpec.doInitialRequest(WebClientSpec.java:259)

              ......

               

              What on earth is that?!

              I guess it's something related to jars!

              and I tried also to place the jars in the domain lib directory, it s the same behaviour....

               

              attached is my war

              • 19. Re: 500 Internal Server Error
                ssilvert

                Nadine,

                 

                It sounds like your container is not Servlet 3 compliant.  What server are you running on?

                 

                Stan

                • 20. Re: 500 Internal Server Error
                  user_00

                  I'm using Glassfish V3 "3.0.1" JEE 6!

                  From within eclipse

                  • 21. Re: 500 Internal Server Error
                    ssilvert

                    For some reason it's not finding the web-fragment.xml and the JSFUnitSCI.class.  Perhaps you are not using the Servlet 3.0 declaration in your web.xml?

                     

                    You need:

                    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

                     

                    You also need to make sure you aren't setting <metadata-complete>true</metadata-complete>, but I doubt that you would be doing that.

                     

                    Stan

                    1 2 Previous Next