• 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

creating Sessionean B

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I am now creating my first Session Bean in EJB3. I created Remote Interface, SessionBean class that impl this interface.
now I am creating client project with Test class to me EJB with lookup.
the question is - how does the client knows the Remote interface? do I have to copy the interface also to the client? bcs now I am getting Compilation error - after activating the lookup and casting the Remote class - that he doesnot familier with the Remote Inteface.

Thanks.
 
sara rod
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi!

could any one please help me..
maybe I didnt explain myself well - my question is - how does the client knows the local /remote class? does a copy of the local/remote class needs to be in the client project? if I dont put it there - I get Compilation error. but it doesnt make sense for me that it should be there.

Thanks!
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sara rod wrote:
Hi!

could any one please help me..
maybe I didnt explain myself well - my question is - how does the client knows the local /remote class? does a copy of the local/remote class needs to be in the client project?

Thanks!


Yes, the local/remote interfaces has to be in the client classpath. The bean implementation class need not be.
 
Ranch Hand
Posts: 65
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right, client does not need to know implementation details. But it has to have interface to your bean on classpath to call EJB methods on it.
 
Our first order of business must be this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic