Skip to Content
author's profile photo Former Member
Former Member

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?.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jul 04, 2005 at 07:47 AM

    For an answer see:


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2009 at 08:11 PM

    Hi Divyakumar Jain,

    I am having the same problem as you!

    I need to call an RFC out either through EJB hosted on a different WebAS instaces of the instance portal which will consume this webservice.

    I wonder if you could kindly send me your EJB project, because I do not have that kind of know-how development.

    I thank your attention.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.