Skip to Content
0
Jan 20, 2023 at 06:40 AM

Error while consuming Northwind service into CAP (java) application

295 Views

Hello,

I am trying to import and mock external service (Northwind) into my bookstore app (java) by following steps given in: https://cap.cloud.sap/docs/guides/using-services

I followed below steps:

1. import API definition using cds import command

cds import ~/Downloads/NorthWind.edmx

It created these files in srv/external folder

image.png

Configured remote service in application.yaml and added dependency to pom.xml

image.png

image.png

When running using cloud profile,

I get ""Failed to start a new transaction"" error to access entities under Northwind services

2. Mock remote service as OData service:

- Added mocked spring profile in application.yaml as below:

image.png

- Added DestinationConfiguration.java file as follows:

image.png

When running app with mocked profile :

mvn spring-boot:run -Dspring-boot.run.profiles=default,mocked

I am getting this error:

image.png

Can someone help?

Regards,

Poorva.

Attachments

image.png (41.5 kB)
image.png (31.8 kB)
image.png (138.0 kB)
image.png (125.5 kB)
image.png (18.5 kB)
image.png (21.8 kB)