[jsfunit-dev] Login form with spring security

Bernd Winterstein bernd.winterstein at googlemail.com
Fri Aug 21 05:38:50 EDT 2009


This seems to be a tomcat specific problem. Are there any known issues?
I tried with the latest tomcat, but the problem is still there.

Bernd

2009/8/20 Bernd Winterstein <bernd.winterstein at googlemail.com>:
> Hi,
> I'm trying to write a test for a JSF application with spring security.
> I see in the logfiles that the test successfully passes the login
> dialog and the welcome page (secured) is loaded.
> Nevertheless the test quits with an exception when creating the
> JSFSession instance:
> IllegalStateException: getAttribute Session already invalidated at
>
> org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1032)
> at
> org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)
> at
> org.jboss.jsfunit.framework.FacesContextBridge.getCurrentInstance(FacesContextBridge.java:56)
> at
> org.jboss.jsfunit.jsfsession.JSFServerSession.pageCreated(JSFServerSession.java:213)
> at
> org.jboss.jsfunit.jsfsession.JSFServerSession.<init>(JSFServerSession.java:56)
> at
> org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:83) at
> JSFUnitTest.testInitialPage(JSFUnitTest.java:43)
>
> regards,
>
> Bernd
>
>
> My test code is:
>
>    WebClientSpec wcSpec = new WebClientSpec("/pages/summary.faces",
> BrowserVersion.FIREFOX_3);
>    FormAuthenticationStrategy formAuth = new
> FormAuthenticationStrategy("test", "test", "loginButton",
> "j_username", "j_password");
>    wcSpec.setInitialRequestStrategy(formAuth);
>
>   JSFSession jsfSession = new JSFSession(wcSpec); // <-- CRASHES
>
>    JSFClientSession client = jsfSession.getJSFClientSession();
>    RichFacesClient ajaxClient = new RichFacesClient(client);
>



More information about the jsfunit-dev mailing list