cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle Destination exception

Former Member
0 Kudos

Hi Champs,

I am using destination service. When I am throwing or catching Destination exception it is giving error

No exception of type DestinationException can be thrown; an exception type must be a subclass of Throwable

NWDS 7.3 SP 8

Dependency : tc/bl/security/destinations/api

Examples for Using the Destination Service API - Using Java - SAP Library

import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import com.sap.security.core.server.destinations.api.DestinationException;
import com.sap.security.core.server.destinations.api.DestinationService;
import com.sap.security.core.server.destinations.api.HTTPDestination;

Context ctx = new InitialContext();
DestinationService dstService = (DestinationService)
ctx.lookup(DestinationService.JNDI_KEY);

if (dstService == null)
throw new NamingException("Destination Service not available");

Destination destination = dstService.getDestination("HTTP","dst-1");
//for HTTP destination: cast
HTTPDestination httpDestination = (HTTPDestination) destination;
//obtain a HTTPUrlConnection from the destinationHttpURLConnection
httpConnection = httpDestination.getURLConnection();



Please help me how to fix this issue

View Entire Topic
former_member193379
Active Contributor
0 Kudos

Hi Arvind

This happens if some class in the type-hierarchy of the exception is not on the class-path.

Please check.

Thanks,

Hamendra