my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes creating Sessionean B Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "creating Sessionean B" Watch "creating Sessionean B" New topic
Author

creating Sessionean B

sara rod
Greenhorn

Joined: Dec 07, 2009
Posts: 23
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

Joined: Dec 07, 2009
Posts: 23

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!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9930
    
159

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.

[My Blog] [JavaRanch Journal]
Anton Shaykin
Ranch Hand

Joined: Dec 13, 2009
Posts: 57

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: creating Sessionean B
 
Similar Threads
How to promote methods in Bean class to remote interface.
EJB - Remote or Local (JBoss)
FBN GUI
ejb client
lookup an EJB3 using local interface from helper classes in weblogic10