[jboss-user] [JBoss Seam] - NPE in SeamSecurity (getCookieValue(Selector.java:59))

mariuszs do-not-reply at jboss.com
Thu Feb 8 10:57:26 EST 2007


I have simple test:

	new FacesRequest() {
  | 
  | 			@Override
  | 			protected void updateModelValues() throws Exception {
  | 				setValue("#{identity.username}", "admin");
  | 				setValue("#{identity.password}", "admin");
  | 			}
  | 
  | 			@Override
  | 			protected void invokeApplication() {
  | 				invokeMethod("#{identity.login}");
  | 			}
  | 
  | 			@Override
  | 			protected void renderResponse() {
  | 
  | assert getValue("#{identity.loggedIn}").equals(true);			}
  | 
  | 		}.run();


FAILED: testUserLogin
  | java.lang.NullPointerException
  | 	at org.jboss.seam.core.Selector.getCookieValue(Selector.java:59)
  | 	at org.jboss.seam.security.Identity.initCredentialsFromCookie(Identity.java:91)
  | 	at org.jboss.seam.security.Identity.create(Identity.java:85)
  | 	at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | 	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
  | 	at org.jboss.seam.Component.callComponentMethod(Component.java:1835)
  | 	at org.jboss.seam.Component.callCreateMethod(Component.java:1783)
  | 	at org.jboss.seam.Component.newInstance(Component.java:1772)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1669)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1636)
  | 	at org.jboss.seam.Namespace.get(Namespace.java:42)
  | 	at javax.el.MapELResolver.getValue(MapELResolver.java:157)
  | 	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:135)
  | 	at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
  | 	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
  | 	at org.jboss.seam.util.UnifiedELValueBinding.getValue(UnifiedELValueBinding.java:34)
  | 	at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:53)
  | 	at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1710)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1659)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1636)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1630)
  | 	at org.jboss.seam.mock.SeamTest.getInstance(SeamTest.java:112)
  | 	at pl.alternativ.med.admin.LoginTest.access$1(LoginTest.java:1)
  | 	at pl.alternativ.med.admin.LoginTest$5.invokeApplication(LoginTest.java:95)
  | 	at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:478)
  | 	at pl.alternativ.med.admin.LoginTest.testUserLogin(LoginTest.java:99)
  | ... Removed 25 stack frames

What is wrong with my test?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013093#4013093

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013093



More information about the jboss-user mailing list