cancel
Showing results for 
Search instead for 
Did you mean: 

ClassCastException using webservice proxy in par after context.lookup

ramanender_singh
Explorer
0 Kudos

Hi

I am trying to use a webservice proxy in a portal application. I am getting a classcast exception where i try to convert the obs received from context.lookup to the service class.

here is th code i am using in the doContent:

try{

InitialContext context = new InitialContext();

Object obj = context.lookup("/wsclients/proxies/<namespace>/<proxy>");

if(obj !=null)

response.write("obj not null");

response.write(obj.getClass().getName());

Service service = (Service) obj;

} catch(Exception ex){

response.write(ex.toString()+"<BR>");

}

this is the output i get :

obj not null

ServiceImpl

java.lang.ClassCastException

Please help sort this out.

Regards

Ramanender Singh

Accepted Solutions (0)

Answers (1)

Answers (1)

ramanender_singh
Explorer
0 Kudos

For benefit of anyone else facing a similar issue.

The issue was resolved by adding a PrivateSharingReference of the deployable proxy DC in portalapp.xml of the PAR

Example

SAPJ2EE::vendorName.com/test_proxy

where test_proxy is the name of the deployable proxy DC

Regards

Ramanender Singh