0

DestinationFacade と Destination の実装で AbstractDestinationFacade を上書きしました。この宛先を介して接続しようとすると、Guava キャッシュからランタイム例外が発生します

ユースケース:: NonCF プラットフォームからリモート システムに接続しようとしています。

私たちのローカル実装は以下のとおりです

LocalDestinationFacade

public class LocalDestinationFacade extends AbstractDestinationFacade {


    @Override
    public Class<? extends GenericDestination> getGenericDestinationClass() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Class<? extends Destination> getDestinationClass() {
        // TODO Auto-generated method stub
        return LocalDestination.class;
    }

    @Override
    public Class<? extends RfcDestination> getRfcDestinationClass() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Map<String, GenericDestination> getGenericDestinationsByName() throws DestinationAccessException {
        Destination localDestination=new LocalDestination("AniPremise", "https://custom-backend-corp/",AuthenticationType.BASIC_AUTHENTICATION,new BasicCredentials("adas", "adas"));
        Map<String, GenericDestination> destinations=new HashMap<>();
        destinations.put("AniPremise", localDestination);
        return destinations;
    }


}

ローカル宛先

public class LocalDestination extends AbstractDestination {

    public LocalDestination(String name, String description, String uri, AuthenticationType authenticationType,
            BasicCredentials basicCredentials, ProxyType proxyType, ProxyConfiguration proxyConfiguration,
            boolean isTrustingAllCertificates, String trustStoreLocation, String trustStorePassword,
            String keyStoreLocation, String keyStorePassword, Map<String, String> propertiesByName) {
        super(name, description, uri, authenticationType, basicCredentials, proxyType, proxyConfiguration,
                isTrustingAllCertificates, trustStoreLocation, trustStorePassword, keyStoreLocation, keyStorePassword,
                propertiesByName);
    }

    public LocalDestination(String name,String uri) {
        this(name, null, uri, null, null, null, null, true, null, null, null, null, Collections.emptyMap());
    }

    public LocalDestination(String name,String uri,AuthenticationType authenticationType,BasicCredentials basicCredentials) {
        this(name, null, uri, authenticationType, basicCredentials,ProxyType.INTERNET , null, false, null, null, null, null, Collections.emptyMap());
    }

    @Override
    public Optional<KeyStore> getTrustStore() throws DestinationAccessException {
        return null;
    }

    @Override
    public Optional<KeyStore> getKeyStore() throws DestinationAccessException {
        return null;
    }

}

宛先に対してクエリを実行すると、次のスタック トレースが生成されます。

com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2051)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3953)
    at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4873)
    at com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientCache.getHttpClient(HttpClientCache.java:51)
    at com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientAccessor.getHttpClient(HttpClientAccessor.java:148)
    at com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientAccessor.getHttpClient(HttpClientAccessor.java:128)
    at com.sap.cloud.sdk.odatav2.connectivity.ODataQuery.internalExecute(ODataQuery.java:242)
    at com.sap.cloud.sdk.odatav2.connectivity.ODataQuery.execute(ODataQuery.java:178)
    at com.sap.cloud.sdk.odatav2.connectivity.ODataQuery.execute(ODataQuery.java:227)
    at com.sap.cloud.sdk.odatav2.connectivity.ODataQuery.execute(ODataQuery.java:201)
    at com.sap.cloud.sdk.s4hana.datamodel.odata.helper.FluentHelperRead.execute(FluentHelperRead.java:244)
    at com.sap.gb.s4backend.dataprovider.S4HanaDataProviderImpl.getPurchaseRequisitionWorkList(S4HanaDataProviderImpl.java:473)
    at com.sap.gb.odata.provisioning.GBOdataRequestProcessor.readEntitySet(GBOdataRequestProcessor.java:102)
4

0 に答える 0