[jboss-user] [JBoss Seam] - Re: Having problems looking up a Seam component in the JNDI

c_inconnu do-not-reply at jboss.com
Fri Apr 13 11:01:13 EDT 2007


Hi,

This is an old thread but i got the exact same problem. Have you managed to get this working ?

I must say that i'm using Maven2. The following works in JBoss AS but not in the microcontainer :

  | @Local
  | public interface Authenticator
  | {
  |     boolean authenticate();
  | }
  | 

and


  | @Name("authenticator")
  | @Stateless public class AuthenticatorAction
  |     implements Authenticator
  | { ... }
  | 

and got


  | ERROR 2007-04-13 16:58:41,187 (SeamLoginModule.java:108) - Error invoking login method
  | org.jboss.seam.InstantiationException: Could not instantiate Seam component: authenticator
  |         at org.jboss.seam.Component.newInstance(Component.java:1740)
  |         at org.jboss.seam.Component.getInstance(Component.java:1643)
  |         at org.jboss.seam.Component.getInstance(Component.java:1610)
  |         at org.jboss.seam.Component.getInstance(Component.java:1604)
  |         at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
  |         at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:135)
  |         at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
  |         at com.sun.el.parser.AstValue.getTarget(AstValue.java:41)
  |         at com.sun.el.parser.AstValue.invoke(AstValue.java:126)
  |         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
  |         at org.jboss.seam.util.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:36)
  |         at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
  |         at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
  |         at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
  |         at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:104)
  |         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:597)
  |         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 java.security.AccessController.doPrivileged(Native Method)
  |         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:247)
  |         at org.jboss.seam.security.Identity.authenticate(Identity.java:240)
  |         at org.jboss.seam.security.Identity.login(Identity.java:170)
  |         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:597)
  |         at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
  |         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
  |         at org.jboss.seam.util.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:36)
  |         at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
  |         at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
  |         at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
  |         at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
  |         at org.jboss.seam.mock.SeamTest$Request.invokeMethod(SeamTest.java:401)
  |         at org.jboss.seam.example.booking.LoginTest$2.invokeApplication(LoginTest.java:76)
  |         at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:489)
  |         at org.jboss.seam.example.booking.LoginTest.testLogin(LoginTest.java:60)
  |         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:597)
  |         at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
  |         at org.testng.internal.Invoker.invokeMethod(Invoker.java:411)
  |         at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:785)
  |         at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:114)
  |         at org.testng.TestRunner.privateRun(TestRunner.java:693)
  |         at org.testng.TestRunner.run(TestRunner.java:574)
  |         at org.testng.SuiteRunner.privateRun(SuiteRunner.java:241)
  |         at org.testng.SuiteRunner.run(SuiteRunner.java:145)
  |         at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:901)
  |         at org.testng.TestNG.runSuitesLocally(TestNG.java:863)
  |         at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeTestNG(TestNGDirectoryTestSuite.java:195)
  |         at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:133)
  |         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
  |         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:597)
  |         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
  |         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
  | Caused by: javax.naming.NameNotFoundException: AuthenticatorAction not bound
  |         at org.jnp.server.NamingServer.getBinding(NamingServer.java:516)
  |         at org.jnp.server.NamingServer.getBinding(NamingServer.java:524)
  |         at org.jnp.server.NamingServer.getObject(NamingServer.java:530)
  |         at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
  |         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
  |         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
  |         at javax.naming.InitialContext.lookup(InitialContext.java:392)
  |         at org.jboss.seam.Component.instantiateSessionBean(Component.java:1107)
  |         at org.jboss.seam.Component.instantiate(Component.java:1093)
  |         at org.jboss.seam.Component.newInstance(Component.java:1736)
  |         ... 65 more
  | 

Although i also got :


  |  INFO 2007-04-13 16:58:34,703 (Component.java:245) - Component: authenticator, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: xxx.actions.AuthenticatorAction, JNDI: AuthenticatorAction/local
  | 

When i look into jndi from my test class

  | InitialContext context = new InitialContext();
  | NamingEnumeration<NameClassPair> enumeration = context.list("java:/");
  | ...
  | 

i got only


  | UserTransaction: org.jboss.tm.usertx.client.ServerVMClientUserTransaction
  | impDatasource: org.jboss.resource.adapter.jdbc.WrapperDataSource
  | TransactionManager: org.jboss.tm.TxManager
  | 

I tried so much things ... Thanks

David

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

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



More information about the jboss-user mailing list