-
1. Re: Lookup stateful ejb
nickarls Sep 24, 2012 7:45 AM (in response to mmatloka)What is the complete JNDI string for the working version?
-
2. Re: Lookup stateful ejb
mmatloka Sep 24, 2012 8:17 AM (in response to nickarls)project.server/MyService!com.ja.MyServiceIf
-
3. Re: Lookup stateful ejb
nickarls Sep 24, 2012 8:47 AM (in response to mmatloka)Perhaps the ?stateful is only applicable for
ejb:<app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-
interface
>?stateful
-
4. Re: Lookup stateful ejb
jaikiran Sep 24, 2012 9:20 AM (in response to mmatloka)Are you sure you are using EJB client JNDI lookup and not the remoting API. See this for the differences https://docs.jboss.org/author/display/AS71/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project
-
5. Re: Lookup stateful ejb
mmatloka Sep 25, 2012 3:27 AM (in response to jaikiran)I have
jndiProperties.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming"
);
in my code, so theoretically ejb client?
-
6. Re: Lookup stateful ejb
jaikiran Sep 25, 2012 4:21 AM (in response to mmatloka)But your JNDI lookup string that you posted, doesn't start with the ejb: namespace so it isn't using the EJB client project and instead is using remoting naming, I believe. Please post the relevant code and the entire exception stacktrace.
-
7. Re: Lookup stateful ejb
mmatloka Oct 3, 2012 2:38 AM (in response to jaikiran)I've moved configuration to jndi.properties
java.naming.provider.url = remote://localhost:4447
java.naming.security.principal = testuser
java.naming.security.credentials = testpassword
java.naming.factory.url.pkgs = org.jboss.ejb.client.naming
java.naming.factory.initial = org.jboss.naming.remote.client.InitialContextFactory
Code does simply context lookup.
My ejb is in war.
For jndi name:
ejb:project.server/MyService!com.ja.MyServiceIf?stateful
java.lang.IllegalArgumentException: object is not an instance of declaring class
For jndi name:
ejb:project.server//MyService!com.ja.MyServiceIf?stateful
ejb:project.server///MyService!com.ja.MyServiceIf?stateful
java.lang.IllegalStateException: No EJB receiver available for handling [appName:project.server,modulename:,distinctname:] combination
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:517)
at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:161)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.doCreateProxy(EjbNamingContext.java:135)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:113)