• Post Reply Bookmark Topic Watch Topic
  • New Topic

WildFly, OpenEJB and simple ejb application

 
Sergei Zhylinski
Ranch Hand
Posts: 86
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Sergei Zhylinski
Ranch Hand
Posts: 86
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for everyone, who has read the topic and is willing to help. I managed to cope with this by myself. I should have read this article first. I have also found the topic on CodeRanch about this issue. So my remote client should look as follows:



Thanks again.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

java:global/firstejb/EmployeeServiceBean!com.sze.ejb.EmployeeService


Try


 
Ron McLeod
Saloon Keeper
Posts: 1263
131
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a similar problem before and found that I needed to prefix the JNDI name with ejb:(instead of java:).
 
Ron McLeod
Saloon Keeper
Posts: 1263
131
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a working example that I had - similar to what you are trying:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!