Skip to Content
avatar image
Former Member

Unable to create destination dynamically though java application in SAP cloud

Hi Experts,

I created one java project in which one of the java file to implement DestinationDataProvider file as below, I am overriding the registerDestinationDataProvider() from DestinationDataProvider.

The corresponding package of the class ( DestinationDataProvider has been added to the class path even though I am getting error like java.lang.NoClassDefFoundError: com/sap/conn/jco/ext/DestinationDataProvider.

also note that I am using other classes from the same package for which no exception is thrown like above, please help

package com.acn.rpa.utilities; import java.util.HashMap; import java.util.Map; import java.util.Properties; import; ///import; import; public class MyDestinationDataProvider implements DestinationDataProvider { Map<String, Properties> propertiesForDestinationName = new HashMap<String, Properties>(); public void addDestination( String destinationName, Properties properties ) { propertiesForDestinationName.put( destinationName, properties ); } public Properties getDestinationProperties( String destinationName ) { if ( propertiesForDestinationName.containsKey( destinationName ) ) { return propertiesForDestinationName.get( destinationName ); } else { throw new RuntimeException( "JCo destination not found: " + destinationName ); } } public void setDestinationDataEventListener( DestinationDataEventListener eventListener ) { // nothing to do } public boolean supportsEvents() { return false; } }


Rajesh V

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    Additional Information:

    For S4 Auto Config : We are Executing RFC of SAP S/4 System through Java Application using SAP Java Connector (3.0). We are able to connect and execute the RFC using destination defined in HCP.

    Problem Statement: Trying to achieve dynamic user id and password creation for destination (which to be configured in HCP). This Dynamic user override is working in Local desktop with apache tomcat. We are facing this issue only in HCP java Environment.

    Following the Code Snipped Used:


    Properties connectProperties = new Properties();

    connectProperties.setProperty(DestinationDataProvider.JCO_DEST, sapSystemDTO.getDestinationName());

    connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, sapSystemDTO.getHostName());

    connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, ""+sapSystemDTO.getSystemNo());

    connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, ""+sapSystemDTO.getSapClientNo());

    connectProperties.setProperty(DestinationDataProvider.JCO_USER, sapSystemDTO.getUserId());

    connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, sapSystemDTO.getPassword());

    connectProperties.setProperty(DestinationDataProvider.JCO_LANG, sapSystemDTO.getLanguage());

    connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");

    connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT, "10");

    MyDestinationDataProvider myDestinationDataProvider = new MyDestinationDataProvider();


    JCoDestination destination = JCoDestinationManager.getDestination(sapSystemDTO.getDestinationName());

    JCoRepository repo = destination.getRepository();

    JCoFunction stfcConnection = null;

    stfcConnection = repo.getFunction("ZRFC");;


    publicclass MyDestinationDataProvider

    implements DestinationDataProvider


    private Hashtable<String, Properties> propertiesTab = new Hashtable<String, Properties>();

    private DestinationDataEventListener eL;

    public Properties getDestinationProperties(String destinationName)







    publicvoid setDestinationDataEventListener(DestinationDataEventListener eventListener)


    this.eL = eventListener;


    void changePropertiesForABAP_AS(Properties pConProps)


    propertiesTab.put(pConProps.getProperty("jco.client.dest"), pConProps);


    publicboolean supportsEvents()





    Error Details:

    <html><head><title>Error report</title></head><body><h1>HTTP Status 500 - org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: com/sap/conn/jco/ext/DestinationDataProvider</h1></body></html>

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 12, 2017 at 09:40 AM

    This Issue still persists, please let me know if any suggestions

    Add comment
    10|10000 characters needed characters exceeded