-
1. Re: Scoped EJB Client Contexts Question: lookup "ejb:" or "java:"
wdfink Nov 11, 2014 11:31 AM (in response to nicolacorsaro)Hello Nicola,
what kind of client do you use? Also what properties do you pass to the InitialContext?
The difference between "java:" and "ejb:" is that java is a typical JNDI lookup but inside of the JVM, often such lookups will only provide internal references.
The "ejb:" is special to JBoss/WildFly for EJB lookups and handled different.
-
2. Re: Scoped EJB Client Contexts Question: lookup "ejb:" or "java:"
nicolacorsaro Nov 11, 2014 2:01 PM (in response to wdfink)Thank you very much for you answer.
The properties are:
Properties jndiProps = new Properties();
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProps.put(Context.PROVIDER_URL,"http-remoting://172.16.1.25:8080");
jndiProps.put(Context.SECURITY_PRINCIPAL, "test");
jbndiProps.put(Context.SECURITY_CREDENTIALS, "test");
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
My program is a Java Swing client. It works very well with JBoss 6 Final.
Now I've changed to Wildfly 8 and I had to change the lookup.
I've made changes following the documentation and the program now works
but is slower than the JBoss 6 version.
Because of this problem with "ejb:" I have the suspect that I've made something wrong.
Please help me. The program is too slow now.
-
3. Re: Scoped EJB Client Contexts Question: lookup "ejb:" or "java:"
nicolacorsaro Nov 12, 2014 3:57 AM (in response to nicolacorsaro)I have also this line in my properties
jndiProps.put("jboss.naming.client.ejb.context", true);
On server side, JNDI names in server.log look like:
java:global/ejbxpallet/DatiUtenteBean!it.xteam.application.xpallet.ejb.local.DatiUtenteLocal
java:app/ejbxpallet/DatiUtenteBean!it.xteam.application.xpallet.ejb.local.DatiUtenteLocal
java:module/DatiUtenteBean!it.xteam.application.xpallet.ejb.local.DatiUtenteLocal
java:global/ejbxpallet/DatiUtenteBean!it.xteam.application.xpallet.ejb.remote.DatiUtenteRemote
java:app/ejbxpallet/DatiUtenteBean!it.xteam.application.xpallet.ejb.remote.DatiUtenteRemote
java:module/DatiUtenteBean!it.xteam.application.xpallet.ejb.remote.DatiUtenteRemote
java:jboss/exported/ejbxpallet/DatiUtenteBean!it.xteam.application.xpallet.ejb.remote.DatiUtenteRemote
So,(with Wildfly 8 Final) if I use
Context ejbRootNamingContext = (Context) new InitialContext(props).lookup("java:");
it always works
If I use:
Context ejbRootNamingContext = (Context) new InitialContext(props).lookup("ejb:");
and jndiProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
the error is:
java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling
If I use:
Context ejbRootNamingContext = (Context) new InitialContext(props).lookup("ejb:");
without jndiProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
the error is:
javax.naming.NameNotFoundException: ejb: -- service jboss.naming.context.java.jboss.exported.ejb:
-
4. Re: Scoped EJB Client Contexts Question: lookup "ejb:" or "java:"
wdfink Nov 13, 2014 8:28 AM (in response to nicolacorsaro)As you use the remote-naming approach the "ejb:" prefix is not allowed for lookup.
Please see teh current document for this Remote EJB invocations via JNDI - EJB client API or remote-naming project
-
5. Re: Scoped EJB Client Contexts Question: lookup "ejb:" or "java:"
nicolacorsaro Nov 13, 2014 11:39 AM (in response to wdfink)Ok, thank you very much Wolf. Now I understand the confusion I've made.