<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Error while consuming Northwind service into CAP (java) application in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaa-p/12658215#M4748920</link>
    <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;marcbecker&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the answer. &lt;/P&gt;&lt;P&gt;Now I am able to run the application locally.&lt;/P&gt;&lt;P&gt;But when I click on service which extends external entity, I get this error : "Error executing the statement"&lt;/P&gt;&lt;P&gt;I have defined entity "clothes" which extends external entity "Products" from mocked Northwind service as follows&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132824-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Also added "ClothStore" service which containing "Clothes" entity &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132825-image.png" /&gt;&lt;/P&gt;&lt;P&gt;When I run application on localhost and click on clothes entity under clothstore service, &lt;/P&gt;&lt;P&gt;I get 500 error with message "Error executing the statement".&lt;/P&gt;&lt;P&gt;I see below error in console,&lt;/P&gt;&lt;P&gt;Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [259]: invalid table name:  Could not find table/view CLOTHSTORE_CLOTHES in schema 829841A637474F279F717E05EC123891: line 1 col 118 (at pos 117)&lt;/P&gt;&lt;P&gt;Also,&lt;/P&gt;&lt;P&gt;in schema.sql, I don't find any table generated for that entity.&lt;/P&gt;&lt;P&gt;Could you please help me resolving this issue ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Poorva.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2023 10:59:37 GMT</pubDate>
    <dc:creator>Poorva_Sonawane</dc:creator>
    <dc:date>2023-01-23T10:59:37Z</dc:date>
    <item>
      <title>Error while consuming Northwind service into CAP (java) application</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaq-p/12658213</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I am trying to import and mock external service (Northwind) into my bookstore app (java) by following steps given in: &lt;A href="https://cap.cloud.sap/docs/guides/using-services" target="test_blank"&gt;https://cap.cloud.sap/docs/guides/using-services&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;I followed below steps:&lt;/P&gt;
  &lt;P&gt;1. import API definition using cds import command&lt;/P&gt;
  &lt;P&gt; cds import ~/Downloads/NorthWind.edmx&lt;/P&gt;
  &lt;P&gt; It created these files in srv/external folder&lt;/P&gt;
  &lt;P&gt; &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132758-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt; Configured remote service in application.yaml and added dependency to pom.xml&lt;/P&gt;
  &lt;P&gt; &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132762-image.png" /&gt; &lt;/P&gt;
  &lt;P&gt; &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132763-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;When running using cloud profile, &lt;/P&gt;
  &lt;P&gt;I get ""Failed to start a new transaction"" error to access entities under Northwind services&lt;/P&gt;
  &lt;P&gt;2. Mock remote service as OData service:&lt;/P&gt;
  &lt;P&gt; - Added mocked spring profile in application.yaml as below:&lt;/P&gt;
  &lt;P&gt; &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132759-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt; - Added DestinationConfiguration.java file as follows:&lt;/P&gt;
  &lt;P&gt; &lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132760-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;When running app with mocked profile :&lt;/P&gt;
  &lt;P&gt;mvn spring-boot:run -Dspring-boot.run.profiles=default,mocked&lt;/P&gt;
  &lt;P&gt;I am getting this error:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132761-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Can someone help?&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Poorva.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 06:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaq-p/12658213</guid>
      <dc:creator>Poorva_Sonawane</dc:creator>
      <dc:date>2023-01-20T06:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error while consuming Northwind service into CAP (java) application</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaa-p/12658214#M4748919</link>
      <description>&lt;P&gt;Your application.yaml is not valid. Under application.services and remote.services we expect a Map or array of services and not directly a service definition. You need to rewrite it like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cds:
  application.services:
  - name: "NorthWind-mocked"
    model: "NorthWind"
    serve.path: "NorthWind
  remote.services:
  - name: NorthWind
    destination:
      name: "northWind-mocked"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Jan 2023 10:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaa-p/12658214#M4748919</guid>
      <dc:creator>marcbecker</dc:creator>
      <dc:date>2023-01-20T10:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error while consuming Northwind service into CAP (java) application</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaa-p/12658215#M4748920</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;marcbecker&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the answer. &lt;/P&gt;&lt;P&gt;Now I am able to run the application locally.&lt;/P&gt;&lt;P&gt;But when I click on service which extends external entity, I get this error : "Error executing the statement"&lt;/P&gt;&lt;P&gt;I have defined entity "clothes" which extends external entity "Products" from mocked Northwind service as follows&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132824-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Also added "ClothStore" service which containing "Clothes" entity &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2132825-image.png" /&gt;&lt;/P&gt;&lt;P&gt;When I run application on localhost and click on clothes entity under clothstore service, &lt;/P&gt;&lt;P&gt;I get 500 error with message "Error executing the statement".&lt;/P&gt;&lt;P&gt;I see below error in console,&lt;/P&gt;&lt;P&gt;Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [259]: invalid table name:  Could not find table/view CLOTHSTORE_CLOTHES in schema 829841A637474F279F717E05EC123891: line 1 col 118 (at pos 117)&lt;/P&gt;&lt;P&gt;Also,&lt;/P&gt;&lt;P&gt;in schema.sql, I don't find any table generated for that entity.&lt;/P&gt;&lt;P&gt;Could you please help me resolving this issue ?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Poorva.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 10:59:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaa-p/12658215#M4748920</guid>
      <dc:creator>Poorva_Sonawane</dc:creator>
      <dc:date>2023-01-23T10:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error while consuming Northwind service into CAP (java) application</title>
      <link>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaa-p/12658216#M4748921</link>
      <description>&lt;P&gt;This seems to be the default behaviour of delegating the query to the database. If you want to delegate incoming API calls to the external service you need to write a custom ON handler for this.&lt;/P&gt;&lt;P&gt;I'd recommend you read through our "Consuming Services" cookbook here: &lt;A href="https://cap.cloud.sap/docs/guides/using-services" target="test_blank"&gt;https://cap.cloud.sap/docs/guides/using-services&lt;/A&gt;&lt;BR /&gt;This case is described exactly here: &lt;A href="https://cap.cloud.sap/docs/guides/using-services#expose-remote-services" target="test_blank"&gt;https://cap.cloud.sap/docs/guides/using-services#expose-remote-services&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 11:43:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-while-consuming-northwind-service-into-cap-java-application/qaa-p/12658216#M4748921</guid>
      <dc:creator>marcbecker</dc:creator>
      <dc:date>2023-01-23T11:43:22Z</dc:date>
    </item>
  </channel>
</rss>

