• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

WildFly, OpenEJB and simple ejb application

 
Ranch Hand
Posts: 89
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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



Try


 
Sheriff
Posts: 4646
582
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 4646
582
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a working example that I had - similar to what you are trying:

 
A timing clock, fuse wire, high explosives and a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic