• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

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).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic