Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting InitialContext for a Remote Client

 
Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know the correct environment for a client accessing an EJB on a remote server running Sun's RI?

java.util.Hashtable env = new java.util.Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"SomeFactory");
env.put(Context.PROVIDER_URL,
"a_server:1090");
 
Keerthi P
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not used RI. But the properties should be defined in 'jndi.properties' file located somewhere. Search for this properties file in j2ee*.jar or in the client jar returned after deployment.
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel,

Include appserv-rt.jar in your classpath. With this, you should be all set with instantiating InitialContext without any parameters at all.

Regards,
Saket
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!