2 Replies Latest reply on Aug 18, 2010 4:29 AM by odelya yomtov

    JSFUnit with Spring Security Filter

    odelya yomtov Novice

      I am trying the example of JSF2+tomcat.

       

      When I don't have Spring Security Filter in my web.xml it works fine.

       

       

      <filter>
      <filter-name>springSecurityFilterChain</filter-name>
      <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
      </filter>
       
       
      <filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      
      
      

      When I have it - it doesn't work and I get the exception:

       

       

      null
      java.lang.NullPointerException
      at org.jboss.jsfunit.framework.FaceletsErrorPageException.isFaceletsErrorPage(FaceletsErrorPageException.java:55)
      at org.jboss.jsfunit.framework.FaceletsErrorPageDetector.afterRequest(FaceletsErrorPageDetector.java:39)
      at org.jboss.jsfunit.framework.JSFUnitWebConnection.notifyListenersAfter(JSFUnitWebConnection.java:100)
      at org.jboss.jsfunit.framework.JSFUnitWebConnection.getResponse(JSFUnitWebConnection.java:82)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1407)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1456)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1456)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1340)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:299)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345)
      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 org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:58)
      at com.mycompany.test.TestExceptions.setUp(TestExceptions.java:50)
      

       

      My TestExceptions.setUp is:

       

      private JSFSession jsfSession;
           private JSFServerSession server;
      
           public void setUp() throws IOException {
                 jsfSession = new JSFSession("/indextest.jsf");
                 server = jsfSession.getJSFServerSession();
           }
      

       

      and indextest.xhtml is a plain page:

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core">
      <body>
         
         <center>
           <f:view>
              <h2><h:outputText value="JSF2 Sample Application"/></h2>
              <h3><h:outputText value="Test Managed Bean Annotations"/></h3>
           </f:view>     
         </center>
      </body>
      </html>
      

       

      What could be the problem?