cancel
Showing results for 
Search instead for 
Did you mean: 

DestinationService lookup from udf fails

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

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

Answers (0)