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

Accepted Solutions (1)

Accepted Solutions (1)

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

Answers (4)

Answers (4)

otto_frost4
Participant
0 Kudos

add DC dependencies as in screenshot

unclear if it is the excpetion/lib, security/lib or security/api

otto_frost4
Participant
0 Kudos

copy from server sap.com~tc~exception~impl.jar

put in project - right click - build path - add to build path

nicolas_p
Explorer
0 Kudos

Hi Arvind

I've had the same issue some time ago. Adding the WD_RUNTIME variable didn't work, so I had to add the class manually.
By adding the class "WD_RUNTIME/com.sap.security_2.0.0.150403083138.jar" it worked (using NWDS 7.31 SP 15).

Search for the "com.sap.security_xxx.jar" and add it to your build path. Should solve the issue.

regards,

Nicolas

former_member193379
Active Contributor
0 Kudos

Hi Arvind,

Please try to change the library reference in your NWDS.

Thanks,

Hamendra