SeamLoginModule - Javassist EJB Stateless Stub does not implement the Local interface
raresp Apr 24, 2008 11:26 PMHello everyone,
I've lost a day and a night trying to get to the bottom of this one. Please help if you can.
Using JBoss 4.2.2.GA, Seam 2.0.1.GA
I am trying to configure seam authenticator as a Stateless EJB but I am getting the following exception:
23:34:03,557 ERROR [SeamLoginModule] Error invoking login method
java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: authenticator
at org.jboss.seam.Component.getInstance(Component.java:1885)
at org.jboss.seam.Component.getInstance(Component.java:1840)
at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:173)
at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:109)
at sun.reflect.GeneratedMethodAccessor335.invoke(Unknown Source)
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)
.....
All my configurations are correct (at least I think they are) therefore I traced the exception in Seam source code and I found out that Component.isInstance() method is actually throwing the exception IllegalArgumentException correctly because the Javassist produced stub for the EJB does not implement the local interface.
Don't know the reason for that, perhaps a BUG?
Here are my settings:
components.xml
...
<core:init jndi-pattern="security-ear/#{ejbName}/local"/>
<core:manager concurrent-request-timeout="500"
conversation-timeout="120000"
conversation-id-parameter="cid"/>
<security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
<event type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentView}"/>
</event>
<event type="org.jboss.seam.security.loginSuccessful">
<action execute="#{redirect.returnToCapturedView}"/>
</event>
<mail:mail-session host="localhost" port="2525" username="test" password="test" />
</components>
The AuthenticatorAction and Authenticator are 100% as in the examples.
Again, please help if you have a clue.
Thank you,
Rares