Hi Everyone,
Could someone please help to cope with JNDI naming in
WildFly? I have deployed a simple stateless session bean into WildFly AS. The output of the server is as follows:
java:global/firstejb/EmployeeServiceBean!com.sze.ejb.EmployeeService
java:app/firstejb/EmployeeServiceBean!com.sze.ejb.EmployeeService
java:module/EmployeeServiceBean!com.sze.ejb.EmployeeService
java:jboss/exported/firstejb/EmployeeServiceBean!com.sze.ejb.EmployeeService
java:global/firstejb/EmployeeServiceBean
java:app/firstejb/EmployeeServiceBean
java:module/EmployeeServiceBean
My bean is a simple transaction scoped stateless session bean with container-managed transaction demarcation:
It has a remote view, so the clients are able to get a reference to it from a separate JVM. My remote client has the following code:
This code works fine with OpenEJB when I specify an OpenEJB context factory. But in WildFly I am always getting the following error:
javax.naming.NameNotFoundException: global/firstejb/EmployeeServiceBean!com.sze.ejb.EmployeeService -- service jboss.naming.context.java.jboss.exported.global.firstejb."EmployeeServiceBean!com.sze.ejb.EmployeeService"
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:104)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)