Skip to Content
avatar image
Former Member

DestinationService lookup from udf fails

A user defined function is utilizing the web-as destination service to obtain RFC connection information. The following class cast exception failure occurs when trying to retrieve the reference to the destination service.

com/sap/security/core/server/destinations/service/LocalDestinationServiceImpl incompatible with com/sap/security/core/server/destinations/api/DestinationService

The following code snipit is provided below. The line that fails is bolded.

-


Context ctx = null;

DestinationService dstService = null;

try {

ctx = new javax.naming.InitialContext();

// lookup destination service

<b>dstService = (DestinationService) ctx.lookup(DestinationService.JNDI_KEY_LOCAL);</b>

} finally {

if (ctx != null) {

ctx.close();

}

}

// Retrieve the destination associated with the pool name

RFCDestination destination = (RFCDestination) dstService.getDestination(

"RFC", poolName);

-


I also tried changing the dstService variable from DestinationService to LocalDestinationServiceImpl, but the same exception occured stating the returned LocalDestinationServiceImpl class was not compatible with itself.

The PI version is 7.0 sp10.

Any help with this is deeply appreciated.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 22, 2007 at 11:29 AM

    I am not sure if you can access the RFC connection information from an UDF, as inside the UDF you are restricted to the deployement descriptor of the Mapping Bean and other J2EE ressources are hidden.

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded