This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

2 basic questions...  RSS feed

 
Murat Balkan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am working on EJB's and there are two points I cannot understand:
First,
The client code says Object o=ic.lookup("Test"); but how does it now where to lookup? Where does it know the servers IP address from???
Second,
When deploying the bean RI, you know, you have to check the deliver jar file check box but it is not enabled by default.(Also I checked 1.4, same)
My question is, what can I or clients do without jar files? How stub classes are send for low level communications??? Why are these disabled.?
Thank you
Murat
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Murat Balkan:
Hi,
I am working on EJB's and there are two points I cannot understand:
First,
The client code says Object o=ic.lookup("Test"); but how does it now where to lookup? Where does it know the servers IP address from???
Second,
When deploying the bean RI, you know, you have to check the deliver jar file check box but it is not enabled by default.(Also I checked 1.4, same)
My question is, what can I or clients do without jar files? How stub classes are send for low level communications??? Why are these disabled.?
Thank you
Murat

Hi,
ic - initial context will give you the provider_url details. If you are using the client in the same system where application server is installed then by default it takes local host as the provider url. Otherwise you have to mention the Initial context factory and provider url details.
For Example In weblogic server to get the initial Context you have to call the following method.
public static Context getInitialContext throws NamingException
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL, "t3://localhost:7001");
return new javax.naming.InitialContext(p);
}

Regards,
M.S.Raman
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!