cancel
Showing results for 
Search instead for 
Did you mean: 

Commerce cloud integration with SCPI - OAuth setup in Commerce Cloud

0 Kudos

Hi Team,

I need to integrate commerce cloud with SCPI to replicate orders and customers.

Here i had started by created oauth client in SCPI and provided required roles to it and tested the token url from postman, token has been generated.

Now i need configure the same in commerce cloud, OAuth client and destination and endpoint. followed attached impex and configured same.
created a job to replicate the order from commerce to scpi and executed the cron job. cronjob is able to identify new order and couldn't able to replicate the order to SCPI.
Please help.oauth-order1.txt

sandeepsoma2
Employee
Employee
0 Kudos

Did you find any exceptions in the logs? Can you paste It here?

0 Kudos

java.lang.IllegalArgumentException: RestTemplateProvider for Credential class class de.hybris.platform.apiregistryservices.model.ExposedOAuthCredentialModel is not registered at de.hybris.platform.apiregistryservices.utils.DefaultRestTemplateFactory.getRestTemplate(DefaultRestTemplateFactory.java:39) ~[classes/:?] at de.hybris.platform.apiregistryservices.services.impl.DefaultDestinationService.getRestTemplate(DefaultDestinationService.java:201) ~[classes/:?] at de.hybris.platform.apiregistryservices.services.impl.DefaultDestinationService.testDestinationUrl(DefaultDestinationService.java:134) ~[classes/:?] at de.hybris.platform.apiregistrybackoffice.actions.TestConsumedDestinationUrlAction.perform(TestConsumedDestinationUrlAction.java:62) ~[?:?] at com.hybris.cockpitng.actions.impl.DefaultActionRenderer.perform(DefaultActionRenderer.java:242) ~[cockpitframework-20.05.1-RC4.jar:?] at com.hybris.cockpitng.actions.impl.DefaultActionRenderer.performWithConfirmationCheck(DefaultActionRenderer.java:262) ~[cockpitframework-20.05.1-RC4.jar:?] at com.hybris.cockpitng.actions.impl.DefaultActionRenderer.lambda$createEventListener$5(DefaultActionRenderer.java:460) ~[cockpitframework-20.05

0 Kudos

oauth credentials configured as type: ExposedOAuthCredential

needs to be configured as: ConsumedOAuthCredential

Now facing one more issue:

Please see the screenshot.

0 Kudos

ERROR [Thread-2693] [DefaultOutboundSyncService] Failed to send item with PK=8796093055021 org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : [no body]; nested exception is rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: org.springframework.security.oauth2.client.OAuth2RestTemplate.class at org.springframework.web.client.HttpServerErrorException.create(HttpServerErrorException.java:100) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:172) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:112) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.security.oauth2.client.http.OAuth2ErrorHandler.handleError(OAuth2ErrorHandler.java:84) ~[spring-security-oauth2-2.3.6.RELEASE.jar:?] at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:785) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:743) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128) ~[spring-security-oauth2-2.3.6.RELEASE.jar:?] at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:677) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:452) ~[spring-web-5.2.3.RELEASE.jar:5.2.3.RELEASE] at de.hybris.platform.outboundservices.facade.impl.DefaultOutboundServiceFacade.lambda$0(DefaultOutboundServiceFacade.java:142) ~[classes/:?] at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69) ~[rxjava-1.3.8.jar:1.3.8] at rx.internal.util.ScalarSynchronousObservable$WeakSingleProducer.request(ScalarSynchronousObservable.java:276) ~[rxjava-1.3.8.jar:1.3.8] at rx.Subscriber.setProducer(Subscriber.java:209) ~[rxjava-1.3.8.jar:1.3.8] at rx.Subscriber.setProducer(Subscriber.java:205) ~[rxjava-1.3.8.jar:1.3.8] at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102) ~[rxjava-1.3.8.jar:1.3.8] at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:138) ~[rxjava-1.3.8.jar:1.3.8] at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:129) ~[rxjava-1.3.8.jar:1.3.8] at rx.Observable.unsafeSubscribe(Observable.java:10327) ~[rxjava-1.3.8.jar:1.3.8] at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48) ~[rxjava-1.3.8.jar:1.3.8] at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33) ~[rxjava-1.3.8.jar:1.3.8] at rx.Observable.subscribe(Observable.java:10423) ~[rxjava-1.3.8.jar:1.3.8] at rx.Observable.subscribe(Observable.java:10390) ~[rxjava-1.3.8.jar:1.3.8] at rx.Observable.subscribe(Observable.java:10230) ~[rxjava-1.3.8.jar:1.3.8] at de.hybris.platform.outboundsync.activator.impl.DefaultOutboundSyncService.synchronizeItem(DefaultOutboundSyncService.java:98) ~[classes/:?] at de.hybris.platform.outboundsync.activator.impl.DefaultOutboundSyncService.synchronizeItem(DefaultOutboundSyncService.java:86) ~[classes/:?] at de.hybris.platform.outboundsync.activator.impl.DefaultOutboundSyncService.sync(DefaultOutboundSyncService.java:69) ~[classes/:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:171) ~[spring-messaging-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120) ~[spring-messaging-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.support.MessagingMethodInvokerHelper$HandlerMethod.invoke(MessagingMethodInvokerHelper.java:1092) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.invokeHandlerMethod(MessagingMethodInvokerHelper.java:581) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:477) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:355) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:108) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:95) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:127) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:177) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:133) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.dispatcher.UnicastingDispatcher.access$000(UnicastingDispatcher.java:55) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.dispatcher.UnicastingDispatcher$1.run(UnicastingDispatcher.java:114) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at org.springframework.integration.util.ErrorHandlingTaskExecutor.lambda$execute$0(ErrorHandlingTaskExecutor.java:57) ~[spring-integration-core-5.2.3.RELEASE.jar:5.2.3.RELEASE] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

sandeepsoma2
Employee
Employee
0 Kudos

Did the payload reach CPI? If yes, can you check the exception in CPI Messages.

0 Kudos

Hi Sandeep,

I did enabled trace on respective artifact in SCPI, i couldn't see any logs there.

0 Kudos

any help? or clues?

Accepted Solutions (0)

Answers (0)