[jboss-user] [EJB 3.0] - Context lookup

rotten_ritz do-not-reply at jboss.com
Tue Nov 13 00:57:25 EST 2007

I have the following interface and bean

userProfile.java //interface
userProfileBean.java //implementation

and i do the following from a servlet

private userProfile UserProfile;
Context context = new InitialContext();
UserProfile = (userProfile)context.lookup("userProfileBean/remote");

It works fine. Im able to invoke the method and get the right return value. 
My query is wouldnt I(client) do a lookup based on the interface, rather than the bean?

shouldn't the lookup be more like this
UserProfile = (userProfile)context.lookup("userProfile/remote");

I just started programming with EJBs and conceptually, lookin up an interface makes sense because the client wouldnt know about the bean implementation. 

Can someone clarify or point me to some link/tutorial which could help me?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103942#4103942

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103942

More information about the jboss-user mailing list