This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

How to get Home reference using JNDI.  RSS feed

 
Ranch Hand
Posts: 257
Firefox Browser Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have deployed my ejb on WebSphere running on Sun server. The name published to JNDI is ejbTest.

I want to get ejb home reference from my windows box. The RMI port on WebSphere is 2809.

Context cs=new InitialContext(); is not working.

Please can any one solve my problem. Just I want to get the reference of the Home Object.

Thank you.
 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a jndi.properties file in the client's classpath?

Basically you need to have the client know where the server is, what is it's "URL", this is usually set in the jndi.properties file or sometimes in a property object in code. The jndi.properties file is preferred.

Mark
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can aither use jndi.property concept or you can use as follows :

String url = //yr server url;
String factory = //yr factory ctx

Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, factory);
properties.put(Context.PROVIDER_URL, url);
Context ctx =InitialContext(properties);

Hope this will work out
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!