• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing EJBs from Tomcat

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an EJB deployed on JBoss 3.07 server which I need to access from a servlet running on a Tomcat engine on another machine. But when i try to do it, I get a lookup failure on the jndi name. I have set the InitialContext as it should be. Any idea what it could be due to. Is there any other setting required in tomcat to access EJBs.

(The same EJB when accessed from the embedded servlet engine in JBoss works fine)
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Tomcat in JBoss is running in the same JVM as the EJB container. For remote access, you need to pass the environmental entries into the constructor of InitialContext. You will need something like this.

 
forest park
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there, thanks for the post. Actually i did it the same way but its not working. I get the following exception.

- Failed to connect to localhost:1099
javax.naming.CommunicationException: Failed to retrieve stub from server localhost:1099 [Root exception is java.io.EOFException]

I am able to access the same EJB successfully from the Tomcat instance thats running within JBOss. Its only for external clients that its failing
reply
    Bookmark Topic Watch Topic
  • New Topic