-
1. Re: Getting javax.naming.NameNotFoundException with wildfly server
jaysensharma Aug 4, 2015 6:12 AM (in response to jagadish1221)The above Error indicates that you are passing an incorrect JNDI name to the lookup method while trying to lookup.
Check your log to see find your EJB is deployed with exactly which JNDI names. As you are migrating from JBoss AS6 to WildFly hence it is quite possible that your code might be trying to use the non EE6 Portable JNDI naming, Which might be leading to this issue.
Check the following link to know more about Portable JNDI Syntax: JNDI Reference - WildFly 8 - Project Documentation Editor to know more about "java:global", "java:app" and "java:module"
Try with the following JNDI format for testing (OR check your log to find the JNDI name listed there for the Bean CrdsEjbController):
java:global[/application name]/module name/enterprise bean name[/interface name]
-
2. Re: Getting javax.naming.NameNotFoundException with wildfly server
jaysensharma Aug 4, 2015 7:08 AM (in response to jaysensharma)Hello Jagadish,
You can try the java:global, java:app, java:module naming prefix for your EJB JNDI lookup based on Where the EJB is actually deployes as part of the same Module/Same App or deployed in the same server as the EJB Client you can choose the suitable JNDI name. However "java:global" prefixed name should work fine in any case where the EJB Bean and the Client is deployed on the same server. So please try the following:
ctx = new InitialContext();
String CRDS_EJB_CONTROLLER = "java:global/DiscoEAR/discoEjb/CrdsEjbController!com.boeing.crds.arch.control.ejb.CrdsEjbControllerHome";
home = (CrdsEjbControllerHome) ctx.lookup(CRDS_EJB_CONTROLLER);
-
3. Re: Getting javax.naming.NameNotFoundException with wildfly server
jagadish1221 Aug 4, 2015 9:09 AM (in response to jaysensharma)Thanks Jay
-
4. Re: Getting javax.naming.NameNotFoundException with wildfly server
jagadish1221 Aug 6, 2015 3:28 AM (in response to jaysensharma)Hi Jay,
Is there any way where we can declare JNDI names globally as below ?
java:global [/application name]/module name/enterprise bean name[/interface name]
Because I have to modify in many places in the same manner for each ejb.
Thanks,
Jagadish