[jboss-user] [JBoss Seam] - Re: SeamSecurity

KoniKoni do-not-reply at jboss.com
Sat Mar 10 14:30:06 EST 2007


thanks, that was...

It doesn't work with both options, i don't understand the difference

between

 @PersistenceContext 
    private EntityManager em;

and


@In EntityManager em;


Code:

try{
  |             Usr usr = (Usr) em.createQuery(
  |                     "from Usr where bname = :username and passwort = :password")
  |                     .setParameter("username", identity.getUsername())
  |                     .setParameter("password", identity.getPassword())
  |                     .getSingleResult();
  |             
  |             if (usr != null) {
  |                 
  |                 log.info("------------------hallo");
  |             }
  |             
  |             return false;
  |         } catch (NoResultException ex) {
  |             FacesMessages.instance().add("Benutzername/Passwort falsch!");
  |             return false;
  |         }


Exeption with @In


20:22:14,139 ERROR [SeamLoginModule] Error invoking login method
javax.faces.el.EvaluationException: Exception while invoking expression #{authenticator.authenticate}
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
        at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:59)
        at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:74)
        at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:102)
        at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
        at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
        at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
        at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
        at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
        at org.jboss.seam.security.Identity.authenticate(Identity.java:206)
        at org.jboss.seam.security.Identity.authenticate(Identity.java:199)
        at org.jboss.seam.security.Identity.login(Identity.java:184)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
        at javax.faces.component.UICommand.broadcast(UICommand.java:106)
Caused by: org.jboss.seam.RequiredException: In attribute requires value for component: authenticator.em
        at org.jboss.seam.Component.getInstanceToInject(Component.java:1920)
        at org.jboss.seam.Component.injectFields(Component.java:1386)
        at org.jboss.seam.Component.inject(Component.java:1156)
        at org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInterceptor.java:76)
        at org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.java:58)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
        at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
        at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
        at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
        at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)


why i do wrong?

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

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



More information about the jboss-user mailing list