6 Replies Latest reply on Dec 4, 2009 5:12 AM by Matthias Leis

    500 Internal Server Error

    Matthias Leis Newbie

      Hi,

      I am developing a web application with Spring Web Flow and want to test it with JUnit.

      I've set up the JSFUnit-Environment (jars, xsl, etc.) and created a first simple test case:

      public void testInitialPage() throws IOException {
      
       WebClientSpec w = new WebClientSpec("/spring/main-flow.htm?_flowId=login-flow", BrowserVersion.FIREFOX_3);
       // Send an HTTP request for the initial page
       JSFSession jsfSession = new JSFSession(w);
      
       // A JSFClientSession emulates the browser and lets you test HTML
       JSFClientSession client = jsfSession.getJSFClientSession();
      
       // A JSFServerSession gives you access to JSF state
       JSFServerSession server = jsfSession.getJSFServerSession();
      
       // Test navigation to initial viewID
       assertEquals("/index.jsp", server.getCurrentViewID());
      
       // Assert that the prompt component is in the component tree and rendered
       UIComponent prompt = server.findComponent("user");
       assertTrue(prompt.isRendered());
       }


      I get the following error from the xsl-Page (which is rendered and all, so I guess the setup is not absolutely wrong ;):
      500 Internal Server Error for http://localhost:8080/.../spring/main-flow.htm?execution=e1s1
      
      com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 500 Internal Server Error for http://localhost:8080/.../spring/main-flow.htm?execution=e1s1
      at com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:530)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:330)
      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)
      at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:81)
      at test.LoginPageTest.testInitialPage(LoginPageTest.java:29)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      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:217)
      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:217)
      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:217)
      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:119)
      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.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)


      I'm new in Spring and JSFUnit. But if I type
      /spring/main-flow.htm?_flowId=login-flow
      in the Browser, I get the the Login-Page of my application. Also by typing
      /spring/main-flow.htm
      oder just
      /spring/
      (of course after localhost... etc.).
      Why am I getting a 500 from Tomcat?

        • 1. Re: 500 Internal Server Error
          Stan Silvert Master

          The partial URL for WebClientSpec and for JSFSession needs to map to the FacesServlet. See the javadoc for details:
          http://labs.jboss.com/file-access/default/members/jsfunit/freezone/apidocs/org/jboss/jsfunit/framework/WebClientSpec.html#WebClientSpec%28java.lang.String%29

          I also suggest that you search this forum for references to Spring and WebFlow. I have not tested Spring myself with JSFUnit and there are some known issues.

          Regards,

          Stan

          • 2. Re: 500 Internal Server Error
            Matthias Leis Newbie

            Thanks for your answer :)

            I took an even closer look at the stack trace. It doesn't seem to be a problem with the mapping to the FacesServlet, because the WebClient get's the correct redirect (the same as the browser gets:

            WebClient - Got a redirect status code [302] new location=[http://localhost:8080/.../spring/main-flow.htm?execution=e1s1]


            But this part of the stack may be interesting:
            13:48:44:030 - DEBUG - FrameworkServlet - Could not complete request
            org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/faces/application/ProjectStage


            I did search this forum for references to Webflow (as you suggested) and found a similar problem here:
            http://www.jboss.org/index.html?module=bb&op=viewtopic&t=152175

            The class ProjectStage is indeed part of JSF 2.0 but I am using JSF 1.2.
            A request from the browser doesn't provoke this call. Why does JSFUnit? And is there a solution?

            • 3. Re: 500 Internal Server Error
              Stan Silvert Master

              Can you post the whole stack trace?

              JSFUnit shouldn't look at the ProjectStage unless it detects a JSF2 environment. So this is surprising.

              Stan

              • 4. Re: 500 Internal Server Error
                Matthias Leis Newbie

                Again, thanks for your reply :)

                Ok, here are the Debug Messages:

                09:45:44:250 - DEBUG - ConfigurationInitializer - <initialize([true])
                09:45:44:250 - DEBUG - ConfigurationInitializer - >initialize
                09:45:44:250 - DEBUG - ServletTestRunner - <doGet([org.apache.catalina.connector.RequestFacade@18c2661], [org.apache.catalina.connector.ResponseFacade@2bbb7b])
                09:45:44:250 - DEBUG - XMLFormatter - <setXslFileName([cactus-report.xsl])
                09:45:44:250 - DEBUG - XMLFormatter - >setXslFileName
                09:45:44:250 - DEBUG - XMLFormatter - <setSuiteClassName([test.LoginPageTest])
                09:45:44:250 - DEBUG - XMLFormatter - >setSuiteClassName
                09:45:44:266 - DEBUG - WebappTestSuiteLoader - <load([test.LoginPageTest])
                09:45:44:266 - DEBUG - ClassLoaderUtils - <loadClass([test.LoginPageTest], [class org.apache.cactus.internal.server.runner.WebappTestSuiteLoader])
                09:45:44:266 - DEBUG - ClassLoaderUtils - <loadClassFromWebappClassLoader([test.LoginPageTest], [class org.apache.cactus.internal.server.runner.WebappTestSuiteLoader])
                09:45:44:297 - DEBUG - ConfigurationInitializer - <initialize([false])
                09:45:44:297 - DEBUG - ConfigurationInitializer - >initialize
                09:45:44:297 - DEBUG - ClassLoaderUtils - >loadClassFromWebappClassLoader = [class test.LoginPageTest]
                09:45:44:297 - DEBUG - ClassLoaderUtils - >loadClass = [class test.LoginPageTest]
                09:45:44:297 - DEBUG - WebappTestSuiteLoader - >load = [class test.LoginPageTest]
                09:45:44:297 - DEBUG - ServerTestCaseCaller - <setDelegatedTest([null(test.LoginPageTest)])
                09:45:44:297 - DEBUG - ServerTestCaseCaller - >setDelegatedTest
                09:45:44:297 - DEBUG - ServerTestCaseCaller - <setWrappedTest([null])
                09:45:44:297 - DEBUG - ServerTestCaseCaller - >setWrappedTest
                09:45:44:297 - DEBUG - XMLFormatter - <startTest([testInitialPage(test.LoginPageTest)])
                09:45:44:297 - DEBUG - XMLFormatter - >startTest
                09:45:44:313 - DEBUG - TestCaseImplementChecker - <checkTestName([testInitialPage(test.LoginPageTest)])
                09:45:44:313 - DEBUG - JUnitVersionHelper - <getTestCaseName([testInitialPage(test.LoginPageTest)])
                09:45:44:313 - DEBUG - JUnitVersionHelper - >getTestCaseName = [testInitialPage]
                09:45:44:313 - DEBUG - TestCaseImplementChecker - >checkTestName
                09:45:44:313 - DEBUG - TestCaseImplementChecker - <checkTestName([null])
                09:45:44:313 - DEBUG - TestCaseImplementChecker - >checkTestName
                09:45:44:313 - DEBUG - JUnitVersionHelper - <getTestCaseName([testInitialPage(test.LoginPageTest)])
                09:45:44:313 - DEBUG - JUnitVersionHelper - >getTestCaseName = [testInitialPage]
                09:45:44:313 - DEBUG - ClientTestCaseCaller - ------------- Test: testInitialPage
                09:45:44:313 - DEBUG - ClientTestCaseCaller - <callGlobalBeginMethod([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [], POST parameters = []])
                09:45:44:313 - DEBUG - ClientTestCaseCaller - >callGlobalBeginMethod
                09:45:44:313 - DEBUG - ClientTestCaseCaller - <callBeginMethod([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [], POST parameters = []])
                09:45:44:313 - DEBUG - JUnitVersionHelper - <getTestCaseName([testInitialPage(test.LoginPageTest)])
                09:45:44:313 - DEBUG - JUnitVersionHelper - >getTestCaseName = [testInitialPage]
                09:45:44:313 - DEBUG - JUnitVersionHelper - <getTestCaseName([testInitialPage(test.LoginPageTest)])
                09:45:44:313 - DEBUG - JUnitVersionHelper - >getTestCaseName = [testInitialPage]
                09:45:44:313 - DEBUG - ClientTestCaseCaller - >callBeginMethod
                09:45:44:313 - DEBUG - HttpProtocolHandler - <runTest([testInitialPage(test.LoginPageTest)], [null], [simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [], POST parameters = []])
                09:45:44:313 - DEBUG - RequestDirectives - <setClassName([test.LoginPageTest])
                09:45:44:313 - DEBUG - BaseWebRequest - <addParameter([Cactus_TestClass], [test.LoginPageTest], [GET])
                09:45:44:313 - DEBUG - BaseWebRequest - >addParameter
                09:45:44:313 - DEBUG - RequestDirectives - >setClassName
                09:45:44:313 - DEBUG - JUnitVersionHelper - <getTestCaseName([testInitialPage(test.LoginPageTest)])
                09:45:44:313 - DEBUG - JUnitVersionHelper - >getTestCaseName = [testInitialPage]
                09:45:44:313 - DEBUG - RequestDirectives - <setMethodName([testInitialPage])
                09:45:44:329 - DEBUG - BaseWebRequest - <addParameter([Cactus_TestMethod], [testInitialPage], [GET])
                09:45:44:329 - DEBUG - BaseWebRequest - >addParameter
                09:45:44:329 - DEBUG - RequestDirectives - >setMethodName
                09:45:44:329 - DEBUG - RequestDirectives - <setAutoSession([true])
                09:45:44:329 - DEBUG - BaseWebRequest - <addParameter([Cactus_AutomaticSession], [true], [GET])
                09:45:44:329 - DEBUG - BaseWebRequest - >addParameter
                09:45:44:329 - DEBUG - RequestDirectives - >setAutoSession
                09:45:44:329 - DEBUG - DefaultHttpClient - <doTest([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [[[Cactus_TestMethod] = [[testInitialPage]]][[Cactus_TestClass] = [[test.LoginPageTest]]][[Cactus_AutomaticSession] = [[true]]]], POST parameters = []])
                09:45:44:329 - DEBUG - BaseWebRequest - <addParameter([Cactus_Service], [CALL_TEST], [GET])
                09:45:44:329 - DEBUG - BaseWebRequest - >addParameter
                09:45:44:344 - DEBUG - AbstractWebConfiguration - <getRedirectorURL([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [[[Cactus_TestMethod] = [[testInitialPage]]][[Cactus_TestClass] = [[test.LoginPageTest]]][[Cactus_AutomaticSession] = [[true]]][[Cactus_Service] = [[CALL_TEST]]]], POST parameters = []])
                09:45:44:344 - DEBUG - AbstractWebConfiguration - <getRedirectorName([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [[[Cactus_TestMethod] = [[testInitialPage]]][[Cactus_TestClass] = [[test.LoginPageTest]]][[Cactus_AutomaticSession] = [[true]]][[Cactus_Service] = [[CALL_TEST]]]], POST parameters = []])
                09:45:44:344 - DEBUG - AbstractWebConfiguration - >getRedirectorName = [ServletRedirector]
                09:45:44:344 - DEBUG - AbstractWebConfiguration - >getRedirectorURL = [http://localhost:8080/ZensusPrototyp/ServletRedirector]
                09:45:44:344 - DEBUG - HttpClientConnectionHelper - <connect([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [[[Cactus_TestMethod] = [[testInitialPage]]][[Cactus_TestClass] = [[test.LoginPageTest]]][[Cactus_AutomaticSession] = [[true]]][[Cactus_Service] = [[CALL_TEST]]]], POST parameters = []], [org.apache.cactus.internal.configuration.DefaultServletConfiguration@62812d])
                09:45:44:375 - DEBUG - HttpUtil - <addHttpGetParameters([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [[[Cactus_TestMethod] = [[testInitialPage]]][[Cactus_TestClass] = [[test.LoginPageTest]]][[Cactus_AutomaticSession] = [[true]]][[Cactus_Service] = [[CALL_TEST]]]], POST parameters = []], [http://localhost:8080/ZensusPrototyp/ServletRedirector])
                09:45:44:375 - DEBUG - BaseWebRequest - <getParameterValuesGet([Cactus_TestMethod])
                09:45:44:375 - DEBUG - BaseWebRequest - >getParameterValuesGet = [[Ljava.lang.String;@1b7b32c]
                09:45:44:375 - DEBUG - BaseWebRequest - <getParameterValuesGet([Cactus_TestClass])
                09:45:44:375 - DEBUG - BaseWebRequest - >getParameterValuesGet = [[Ljava.lang.String;@154283a]
                09:45:44:375 - DEBUG - BaseWebRequest - <getParameterValuesGet([Cactus_AutomaticSession])
                09:45:44:375 - DEBUG - BaseWebRequest - >getParameterValuesGet = [[Ljava.lang.String;@1d29c1]
                09:45:44:375 - DEBUG - BaseWebRequest - <getParameterValuesGet([Cactus_Service])
                09:45:44:375 - DEBUG - BaseWebRequest - >getParameterValuesGet = [[Ljava.lang.String;@a06d25]
                09:45:44:375 - DEBUG - HttpUtil - >addHttpGetParameters = [http://localhost:8080/ZensusPrototyp/ServletRedirector?Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST]
                09:45:44:375 - DEBUG - UrlUtil - <getPath([http://localhost:8080/ZensusPrototyp/ServletRedirector?Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST])
                09:45:44:375 - DEBUG - UrlUtil - >getPath = [/ZensusPrototyp/ServletRedirector]
                09:45:44:375 - DEBUG - UrlUtil - <getQuery([http://localhost:8080/ZensusPrototyp/ServletRedirector?Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST])
                09:45:44:375 - DEBUG - UrlUtil - >getQuery = [Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST]
                09:45:44:375 - DEBUG - CookieUtil - <createHttpClientCookies([simulation URL = [null], automatic session = [true], cookies = [], headers = [], GET parameters = [[[Cactus_TestMethod] = [[testInitialPage]]][[Cactus_TestClass] = [[test.LoginPageTest]]][[Cactus_AutomaticSession] = [[true]]][[Cactus_Service] = [[CALL_TEST]]]], POST parameters = []], [http://localhost:8080/ZensusPrototyp/ServletRedirector?Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST])
                09:45:44:375 - DEBUG - CookieUtil - >createHttpClientCookies = [[Lorg.apache.commons.httpclient.Cookie;@194a1e9]
                09:45:44:422 - DEBUG - ConfigurationInitializer - <initialize([false])
                09:45:44:422 - DEBUG - ConfigurationInitializer - >initialize
                09:45:44:422 - DEBUG - ServletTestRedirector - <doGet([org.apache.catalina.connector.RequestFacade@1f34d0], [org.apache.catalina.connector.ResponseFacade@c44cfb])
                09:45:44:422 - DEBUG - ServletTestRedirector - <doPost([org.apache.catalina.connector.RequestFacade@1f34d0], [org.apache.catalina.connector.ResponseFacade@c44cfb])
                09:45:44:422 - DEBUG - ServletTestRedirector - ------------- Start Servlet service
                09:45:44:438 - DEBUG - AbstractWebImplicitObjects - <setHttpServletRequest([org.apache.catalina.connector.RequestFacade@1f34d0])
                09:45:44:438 - DEBUG - AbstractWebImplicitObjects - >setHttpServletRequest
                09:45:44:438 - DEBUG - AbstractWebImplicitObjects - <setHttpServletResponse([org.apache.catalina.connector.ResponseFacade@c44cfb])
                09:45:44:438 - DEBUG - AbstractWebImplicitObjects - >setHttpServletResponse
                09:45:44:438 - DEBUG - AbstractWebImplicitObjects - <setServletContext([org.apache.catalina.core.ApplicationContextFacade@1f10a67])
                09:45:44:438 - DEBUG - AbstractWebImplicitObjects - >setServletContext
                09:45:44:438 - DEBUG - ServletImplicitObjects - <setServletConfig([org.apache.catalina.core.StandardWrapperFacade@8a2f6b])
                09:45:44:438 - DEBUG - ServletImplicitObjects - >setServletConfig
                09:45:44:438 - DEBUG - AbstractWebTestController - <handleRequest([org.apache.cactus.internal.server.ServletImplicitObjects@16686c8])
                09:45:44:438 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_Service])
                09:45:44:438 - DEBUG - ServletUtil - >getQueryStringParameter = [CALL_TEST]
                09:45:44:438 - DEBUG - AbstractWebTestController - Service to call = CALL_TEST
                09:45:44:438 - DEBUG - ServiceEnumeration - <valueOf([CALL_TEST])
                09:45:44:438 - DEBUG - ServiceEnumeration - >valueOf = [CALL_TEST]
                09:45:44:438 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_TestClass])
                09:45:44:438 - DEBUG - ServletUtil - >getQueryStringParameter = [test.LoginPageTest]
                09:45:44:438 - DEBUG - AbstractWebTestCaller - Class to call = [test.LoginPageTest]
                09:45:44:438 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_WrappedTestClass])
                09:45:44:438 - DEBUG - ServletUtil - >getQueryStringParameter = [null]
                09:45:44:438 - DEBUG - AbstractWebTestCaller - No wrapped test class
                09:45:44:438 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_TestMethod])
                09:45:44:438 - DEBUG - ServletUtil - >getQueryStringParameter = [testInitialPage]
                09:45:44:438 - DEBUG - AbstractWebTestCaller - Method to call = testInitialPage
                09:45:44:438 - DEBUG - ClassLoaderUtils - <loadClass([test.LoginPageTest], [class org.apache.cactus.internal.server.ServletTestCaller])
                09:45:44:438 - DEBUG - ClassLoaderUtils - <loadClassFromWebappClassLoader([test.LoginPageTest], [class org.apache.cactus.internal.server.ServletTestCaller])
                09:45:44:454 - DEBUG - ClassLoaderUtils - >loadClassFromWebappClassLoader = [class test.LoginPageTest]
                09:45:44:454 - DEBUG - ClassLoaderUtils - >loadClass = [class test.LoginPageTest]
                09:45:44:454 - DEBUG - ServerTestCaseCaller - <setDelegatedTest([null(test.LoginPageTest)])
                09:45:44:454 - DEBUG - ServerTestCaseCaller - >setDelegatedTest
                09:45:44:454 - DEBUG - ServerTestCaseCaller - <setWrappedTest([null])
                09:45:44:454 - DEBUG - ServerTestCaseCaller - >setWrappedTest
                09:45:44:454 - DEBUG - ServletURL - <loadFromRequest([org.apache.catalina.connector.RequestFacade@1f34d0])
                09:45:44:454 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_URL_Protocol])
                09:45:44:454 - DEBUG - ServletUtil - >getQueryStringParameter = [null]
                09:45:44:454 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_URL_Server])
                09:45:44:454 - DEBUG - ServletUtil - >getQueryStringParameter = [null]
                09:45:44:454 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_URL_ContextPath])
                09:45:44:454 - DEBUG - ServletUtil - >getQueryStringParameter = [null]
                09:45:44:454 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_URL_ServletPath])
                09:45:44:454 - DEBUG - ServletUtil - >getQueryStringParameter = [null]
                09:45:44:454 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_URL_PathInfo])
                09:45:44:454 - DEBUG - ServletUtil - >getQueryStringParameter = [null]
                09:45:44:454 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_URL_QueryString])
                09:45:44:454 - DEBUG - ServletUtil - >getQueryStringParameter = [null]
                09:45:44:454 - DEBUG - ServletURL - Undefined simulation URL
                09:45:44:454 - DEBUG - ServletURL - >loadFromRequest = [null]
                09:45:44:469 - DEBUG - ServletUtil - <getQueryStringParameter([Cactus_TestMethod=testInitialPage&Cactus_TestClass=test.LoginPageTest&Cactus_AutomaticSession=true&Cactus_Service=CALL_TEST], [Cactus_AutomaticSession])
                09:45:44:469 - DEBUG - ServletUtil - >getQueryStringParameter = [true]
                09:45:44:469 - DEBUG - AbstractWebTestCaller - Auto session is true
                09:45:44:641 - DEBUG - WebClient - Get page for window named '', using WebRequestSettings[<url="http://localhost:8080/ZensusPrototyp/spring/main-flow.htm", GET, EncodingType[name=application/x-www-form-urlencoded], [], {Accept-Language=en, Accept=*/*}, null>]
                09:45:44:641 - DEBUG - WebClient - Load response for http://localhost:8080/ZensusPrototyp/spring/main-flow.htm
                09:45:44:672 - DEBUG - DispatcherServlet - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' determining Last-Modified value for [/ZensusPrototyp/spring/main-flow.htm]
                09:45:44:672 - DEBUG - AbstractUrlHandlerMapping - Mapping [/main-flow.htm] to handler 'org.springframework.webflow.mvc.servlet.FlowController@e6899'
                09:45:44:672 - DEBUG - DispatcherServlet - Last-Modified value for [/ZensusPrototyp/spring/main-flow.htm] is: -1
                09:45:44:672 - DEBUG - DispatcherServlet - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' processing request for [/ZensusPrototyp/spring/main-flow.htm]
                09:45:44:672 - DEBUG - FlowExecutorImpl - Launching new execution of flow 'main-flow' with input null
                09:45:44:672 - DEBUG - FlowDefinitionRegistryImpl - Getting FlowDefinition with id 'main-flow'
                09:45:44:672 - DEBUG - FlowExecutionImplFactory - Creating new execution of 'main-flow'
                09:45:44:672 - DEBUG - FlowExecutionImpl - Starting in org.springframework.webflow.mvc.servlet.MvcExternalContext@523ca2 with input null
                09:45:44:672 - DEBUG - State - Entering state 'login' of flow 'main-flow'
                09:45:44:672 - DEBUG - FlowDefinitionRegistryImpl - Getting FlowDefinition with id 'login-flow'
                09:45:44:672 - DEBUG - SubflowState - Calling subflow 'login-flow' with input map[[empty]]
                09:45:44:672 - DEBUG - Flow - Creating [FlowVariable@1f2e41d name = 'checkuser', valueFactory = [BeanFactoryVariableValueFactory@15e4dbe type = String]]
                09:45:44:672 - DEBUG - AbstractAutowireCapableBeanFactory$1 - Creating instance of bean 'java.lang.String'
                09:45:44:672 - DEBUG - AbstractAutowireCapableBeanFactory$1 - Finished creating instance of bean 'java.lang.String'
                09:45:44:672 - DEBUG - Flow - Creating [FlowVariable@151e824 name = 'user', valueFactory = [BeanFactoryVariableValueFactory@5fadce type = Prototyp_User]]
                09:45:44:672 - DEBUG - AbstractAutowireCapableBeanFactory$1 - Creating instance of bean 'model.Prototyp_User'
                09:45:44:672 - DEBUG - AbstractAutowireCapableBeanFactory$1 - Finished creating instance of bean 'model.Prototyp_User'
                09:45:44:672 - DEBUG - State - Entering state 'login' of flow 'login-flow'
                09:45:44:672 - DEBUG - ContainedConversation - Putting conversation attribute 'name' with value main-flow
                09:45:44:672 - DEBUG - ContainedConversation - Putting conversation attribute 'caption' with value null
                09:45:44:672 - DEBUG - ContainedConversation - Putting conversation attribute 'description' with value null
                09:45:44:672 - DEBUG - ContainedConversation - Putting conversation attribute 'flowExecutionSnapshotGroup' with value org.springframework.webflow.execution.repository.impl.SimpleFlowExecutionSnapshotGroup@89db9a
                09:45:44:672 - DEBUG - FlowExecutionImpl - Assigned key e1s1
                09:45:44:672 - DEBUG - DefaultFlowExecutionRepository - Putting flow execution '[FlowExecutionImpl@b09321 flow = 'main-flow', flowSessions = list[[FlowSessionImpl@8b83e3 flow = 'main-flow', state = 'login', scope = map[[empty]]], [FlowSessionImpl@17fc1e7 flow = 'login-flow', state = 'login', scope = map['checkuser' -> '', 'user' -> model.Prototyp_User@933c07, 'viewScope' -> map[[empty]]]]]]' into repository
                09:45:44:672 - DEBUG - DefaultFlowExecutionRepository - Adding snapshot to group with id 1
                09:45:44:672 - DEBUG - ContainedConversation - Putting conversation attribute 'scope' with value map['flashScope' -> map['messagesMemento' -> map[[null] -> list[[empty]]]]]
                09:45:44:672 - DEBUG - FlowHandlerAdapter - Sending flow execution redirect to '/ZensusPrototyp/spring/main-flow.htm?execution=e1s1'
                09:45:44:672 - DEBUG - DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'Spring MVC Dispatcher Servlet': assuming HandlerAdapter completed request handling
                09:45:44:672 - DEBUG - FrameworkServlet - Successfully completed request
                09:45:44:688 - DEBUG - WebClient - Got a redirect status code [302] new location=[http://localhost:8080/ZensusPrototyp/spring/main-flow.htm?execution=e1s1]
                09:45:44:688 - DEBUG - WebClient - Load response for http://localhost:8080/ZensusPrototyp/spring/main-flow.htm?execution=e1s1
                09:45:44:688 - DEBUG - DispatcherServlet - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' determining Last-Modified value for [/ZensusPrototyp/spring/main-flow.htm]
                09:45:44:688 - DEBUG - AbstractUrlHandlerMapping - Mapping [/main-flow.htm] to handler 'org.springframework.webflow.mvc.servlet.FlowController@e6899'
                09:45:44:688 - DEBUG - DispatcherServlet - Last-Modified value for [/ZensusPrototyp/spring/main-flow.htm] is: -1
                09:45:44:688 - DEBUG - DispatcherServlet - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' processing request for [/ZensusPrototyp/spring/main-flow.htm]
                09:45:44:688 - DEBUG - FlowExecutorImpl - Resuming flow execution with key 'e1s1
                09:45:44:688 - DEBUG - ContainedConversation - Locking conversation 1
                09:45:44:688 - DEBUG - DefaultFlowExecutionRepository - Getting flow execution with key 'e1s1'
                09:45:44:688 - DEBUG - FlowDefinitionRegistryImpl - Getting FlowDefinition with id 'main-flow'
                09:45:44:688 - DEBUG - FlowDefinitionRegistryImpl - Getting FlowDefinition with id 'login-flow'
                09:45:44:688 - DEBUG - FlowExecutionImpl - Resuming in org.springframework.webflow.mvc.servlet.MvcExternalContext@a50a00
                09:45:44:688 - DEBUG - Flow - Restoring [FlowVariable@1f2e41d name = 'checkuser', valueFactory = [BeanFactoryVariableValueFactory@15e4dbe type = String]]
                09:45:44:688 - DEBUG - Flow - Restoring [FlowVariable@151e824 name = 'user', valueFactory = [BeanFactoryVariableValueFactory@5fadce type = Prototyp_User]]
                09:45:44:688 - DEBUG - RequestLoggingPhaseListener - Entering JSF Phase: RESTORE_VIEW(1)
                09:45:44:688 - DEBUG - FlowViewStateManager - No matching view in view scope
                09:45:44:688 - DEBUG - JsfViewFactory - Creating UIViewRoot from 'Login.xhtml'
                09:45:44:688 - DEBUG - ViewState - Rendering + [JSFView = '/pages/login-flow/Login.xhtml']
                09:45:44:688 - DEBUG - ViewState - Flash scope = map[[empty]]
                09:45:44:688 - DEBUG - ViewState - Messages = [DefaultMessageContext@92b7c2 sourceMessages = map[[null] -> list[[empty]]]]
                09:45:44:688 - DEBUG - RequestLoggingPhaseListener - Entering JSF Phase: RENDER_RESPONSE(6)
                09:45:44:688 - DEBUG - JsfView - Asking view handler to render view
                09:45:44:704 - DEBUG - JsfView - View rendering complete
                09:45:44:704 - DEBUG - ContainedConversation - Unlocking conversation 1
                09:45:44:704 - DEBUG - FrameworkServlet - Could not complete request




                And here comes the stacktrace:
                org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/faces/application/ProjectStage
                 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:924)
                 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
                 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
                 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
                 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.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
                 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.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.NoClassDefFoundError: javax/faces/application/ProjectStage
                 at java.lang.Class.getDeclaredMethods0(Native Method)
                 at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
                 at java.lang.Class.getMethod0(Unknown Source)
                 at java.lang.Class.getMethod(Unknown Source)
                 at org.springframework.util.ClassUtils.getMethodIfAvailable(ClassUtils.java:549)
                 at org.springframework.faces.webflow.FlowFacesContext.getELContext(FlowFacesContext.java:97)
                 at com.sun.facelets.el.ELAdaptor.getELContext(ELAdaptor.java:45)
                 at com.sun.facelets.impl.DefaultFaceletContext.<init>(DefaultFaceletContext.java:86)
                 at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:91)
                 at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
                 at org.springframework.faces.webflow.JsfView.render(JsfView.java:89)
                 at org.springframework.webflow.engine.ViewState.render(ViewState.java:282)
                 at org.springframework.webflow.engine.ViewState.refresh(ViewState.java:241)
                 at org.springframework.webflow.engine.ViewState.resume(ViewState.java:219)
                 at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
                 at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
                 at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:163)
                 at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
                 at org.springframework.webflow.mvc.servlet.FlowController.handleRequest(FlowController.java:174)
                 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
                 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
                 ... 20 more
                Caused by: java.lang.ClassNotFoundException: javax.faces.application.ProjectStage
                 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
                 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
                 at java.lang.ClassLoader.loadClassInternal(Unknown Source)
                 ... 42 more


                • 5. Re: 500 Internal Server Error
                  Stan Silvert Master

                  Looks like Spring WebFlow sees that the JSFUnit FacesContext has a getProjectStage() method. And because of that, WebFlow thinks it is OK to call it even though you are running JSF 1.x. If you were running JSF2 you would obviously be able to get past this problem.

                  I'd like to know what the "... 42 more" at the end of the stack trace refers to, but I think I've got it right.

                  I don't know when I can fix this because I don't know anything about Spring WebFlow. Perhaps someone in the community can step forward and help out.

                  Stan

                  • 6. Re: 500 Internal Server Error
                    Matthias Leis Newbie

                    Thanks again for your reply. Next year I will migrate to JSF 2.0 anyway, then we will see if you were right ;)

                    I greatly appreciate your help!!! :)