[Logo]
Forums Register Login
How to get Home reference using JNDI.
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.
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
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
It's just a flesh wound! Or a tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS


This thread has been viewed 584 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 18, 2018 12:37:36.