-
1. Re: Having problems looking up a Seam component in the JNDI
pmuir Oct 3, 2006 12:50 PM (in response to zzzz8)I'm pretty sure Seam components aren't registered in JNDI, EJB3 session beans are though - The JNDI name in the Seam startup refers to this. I would suggest asking on the EJB3 forum about JNDI lookup of EJB3 session beans.
-
2. Re: Having problems looking up a Seam component in the JNDI
c_inconnu Apr 13, 2007 11:01 AM (in response to zzzz8)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 gotERROR 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 classInitialContext context = new InitialContext(); NamingEnumeration<NameClassPair> enumeration = context.list("java:/"); ...
i got onlyUserTransaction: 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 -
3. Re: Having problems looking up a Seam component in the JNDI
zzzz8 Apr 14, 2007 11:02 PM (in response to zzzz8)I asked the same question in the EJB3 forum a while back and I didn't get a reply there either. I did not make any progress on this issue (and abandoned it). So unfortunately, I can't offer much help...
-
4. Re: Having problems looking up a Seam component in the JNDI
c_inconnu Apr 15, 2007 12:49 PM (in response to zzzz8)"zzzz8" wrote:
I asked the same question in the EJB3 forum a while back and I didn't get a reply there either. I did not make any progress on this issue (and abandoned it). So unfortunately, I can't offer much help...
Thanks...
Anyone from the Seam team ? Please ? -
5. Re: Having problems looking up a Seam component in the JNDI
christian.bauer Apr 15, 2007 5:07 PM (in response to zzzz8)
java:comp/env/ejb/TestConnectionBean/local
This just not the right JNDI lookup to get a remote EJB handle. I'm not sure what the right lookup is (definitely not with an ENC prefix) and if the old E-EJB3 container even supports remote JNDI/remote EJBs. I don't think it does.
All of this has not much to do with Seam, though. -
6. Re: Having problems looking up a Seam component in the JNDI
christian.bauer Apr 15, 2007 5:09 PM (in response to zzzz8)The newer Embedded JBoss5 container supports remote EJB/JNDI by the way, check the wiki. Now we only need a release of this and someone who will update all the Seam examples and the testing framework :)
-
7. Re: Having problems looking up a Seam component in the JNDI
kosiakk Oct 2, 2007 7:00 PM (in response to zzzz8)@Local interface is redundant now!
just write@Name("authenticator") public class AuthenticatorAction { ... }
and it will work after Seam2 integration =)