Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Deployable proxy -JNDI lookup

Hi All,

I've created a Deployable proxy for my webservice and deployed the EAR. I can see JNDI registry in the visual administrator.

I am now writing a simple java client to call the proxy.

1.

try {

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");

env.put(Context.PROVIDER_URL, "localhost:50104");

Context ctx = new InitialContext(env);

Object obj = ctx.lookup("/wsclients/proxies/sap.com/flight");

FlightListService ser=(FlightListService)obj;

}

Lookup went fine…but I am getting classcastexception at the stsetment "FlightListService ser=(FlightListService)obj;"

2.

try {

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");

env.put(Context.PROVIDER_URL, "localhost:50104");

Context ctx = new InitialContext(env);

Object obj = ctx.lookup("/wsclients/proxies/sap.com/flight/com.sap.flight");

FlightListService ser=(FlightListService)obj;

}

In the above case Lookup itself failed.

Please let me knowthe solution.

Regards,Anilkumar

Former Member
Not what you were looking for? View more on this topic or Ask a question