Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

WildFly, OpenEJB and simple ejb application

 
Ranch Hand
Posts: 89
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: 89
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.
 
Sheriff
Posts: 10445
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


 
Saloon Keeper
Posts: 2722
354
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • 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: 2722
354
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • 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:

 
Your mother was a hamster and your father was a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!