cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup of RFC Destinations

Former Member
0 Kudos

Hello Everybody,

I wanted to use Destinations API in webdynpro api.

I have written following line of code:

Context ctx = new InitialContext();

wdComponentAPI.getMessageManager().reportWarning("JNDI: "+DestinationService.JNDI_KEY);

DestinationService dstService = (DestinationService) ctx.lookup(DestinationService.JNDI_KEY);

if (dstService == null)

throw new NamingException("Destination Service not available");

RFCDestination dst =

(RFCDestination) dstService.getDestination("RFC", "CDMEXTN");

int maxPoolSize = dst.getMaxPoolSize();

long maxWaitTime = dst.getMaxWaitTime();

Properties jcoProperties = dst.getJCoProperties();

But at the time of look up it is giving me error:

java.lang.NoClassDefFoundError: com/sap/security/core/server/destinations/api/DestinationService

Why application cannot find this class on the server runtime?

what should be the problem?

Thanks in advance,

Bhavik

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bhavik,

RightClick on the project->Goto Properties

try adding library "tcsecdestinations~interface" in the interface references of WebDynpro reference.

"tcsecdestinations~service " in the library references.

Regards, Anilkumar

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bhavik,

Check for the jar file in your server installation

Ex :C:\usr\sap\<ID>\<InstanceID>\j2ee\cluster\server0\bin\interfaces\tcsecdestinations~interface\

Regards, Anilkumar

Former Member
0 Kudos

Hi Anilkumar,

I have checked the jar file at the location you have specified. Jar file is there.

But still I am getting ClassNotFoundException when I am trying to execute following code in my Webdynpro application.

Context ctx = new InitialContext();

wdComponentAPI.getMessageManager().reportWarning("JNDI: "+DestinationService.JNDI_KEY);

DestinationService dstService = (DestinationService) ctx.lookup(DestinationService.JNDI_KEY);

if (dstService == null)

throw new NamingException("Destination Service not available");

RFCDestination dst =

(RFCDestination) dstService.getDestination("RFC", "CDMEXTN");

int maxPoolSize = dst.getMaxPoolSize();

long maxWaitTime = dst.getMaxWaitTime();

Properties jcoProperties = dst.getJCoProperties();

/**

  • Code example for establishing a direct connection

*/

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

wdContext.currentZcdm_Get_Saplov_InputElement().modelObject().modelInstance().setJcoClient(client);

wdContext.currentZcdm_Get_Saplov_InputElement().modelObject().execute();

Do I need to specify any sharing. service or library reference in Webdypro references?

Thanks,

Bhavik