• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Access EJB from different EAR

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

If I have two EAR file. I want to acess EJB of Ear 1 from web application of EAR2. Can we do it? Do we have J2EE standard for that? Is it Servler specific?

Thanks
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't use EJB linking in the deployment descriptor, but they can still talk to each other. Not sure if local interfaces would work (never tried it across ears) but remote interfaces and JMS-based communications would definitely work.
 
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 J2EE standard is that the client obtains an InitialContext (needs to pass in the right environment variables into the constructor) and uses it to do a JNDI lookup of the EJB's home. You are now on the home straight. (Sorry, bad joke. :roll: ) The stub returned needs to be narrowed and cast to the EJB's home interface. For a stateless session bean, the home stub is then used to obtain the remote EJB object stub (used to call business methods).
 
Something about .... going for a swim. With this tiny ad ...
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic