Skip to Content
Former Member
Jul 04, 2005 at 07:45 AM

RFC Destination in WAS sp12


Hi All,

I am using WAS 6.4 with sp12 which supports RFC destination.

I have created a EJb which is internally using JCo to connect to SAP R/3. I am using RFC Destination for passing login information to SAP R/3. I have exposed this EJb as web service.

Now in EJb i have following code

<b>InitialContext ctx = new InitialContext();

obj = ctx.lookup(DestinationService.JNDI_KEY);

<i>DestinationService dstService = (DestinationService) obj;</i>

RFCDestination dst = (RFCDestination) dstService.getDestination("RFC", "<System ID>");

Properties jcoProperties = dst.getJCoProperties();

JCO.Client client = JCO.createClient(jcoProperties);


But when i execute the code it give Exeception in EJb that in could not type cast the obj into DestinationService Object. when i check the Object return by ctx.lookup it is of type proxy

I have taken above code from the location

Why am not able to type cast the object?.