sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
732 stars 778 forks source link

Connect to OData Service on Cloud Foundry Using SAP Cloud SDK #4421

Closed agl-phenr closed 4 years ago

agl-phenr commented 4 years ago

Tutorial URL: https://developers.sap.com/tutorials/s4sdk-odata-service-cloud-foundry.html

Please specify the step you are referring to: step 6 - deploy the project

Compilation error: [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /C:/simpleCFApp/application/src/main/java/com/sap/cloud/sdk/tutorial/BusinessPartnerServlet.java:[17,55] package com.sap.cloud.sdk.s4hana.datamodel.odata.helper does not exist [ERROR] /C:/simpleCFApp/application/src/main/java/com/sap/cloud/sdk/tutorial/BusinessPartnerServlet.java:[43,65] cannot find symbol symbol: variable Order location: class com.sap.cloud.sdk.tutorial.BusinessPartnerServlet

Can you let me know which package shall I use instead?

BR, Pietro

agl-phenr commented 4 years ago

compilation error.txt

Emdee89 commented 4 years ago

Pls share the affected source code snippet and show us your dependency tree.

agl-phenr commented 4 years ago

Hi @Emdee89 ,

Find enclosed the files requested.

firstapp.zip

BR, Pietro

MatKuhr commented 4 years ago

The zip file you provided does not look like a valid project setup. Did you only sent a subset of your files? Please provide the entire setup as this seems to be a setup issue. Did you use our archetype to create the application as described here?

agl-phenr commented 4 years ago

Hi @MatKuhr ,

I am sorry. I´ve attached the servlet and POM file only. Now I am sending the whole project along.

simpleCFApp.zip

BR, Pietro

MatKuhr commented 4 years ago

Thank you. The problem seems to be the package naming, as you already suspected. Maybe your IDE autocompleted the import for you but from an old module. Actually the import should be com.sap.cloud.sdk.datamodel.odata.helper.Order instead of com.sap.cloud.sdk.s4hana.datamodel.odata.helper.Order.

I double checked that it's correct in the tutorial. Also I quickly checked that your project compiles with this change, which it does with one more change: Your execute() method call is lacking a destination that needs to be provided as an argument. Consider the code in step 5 of the tutorial. If you provide a destination there the code compiles.

agl-phenr commented 4 years ago

Hi @MatKuhr, It sorted out issues. Thanks a lot.

Pietro

agl-phenr commented 4 years ago

Issue fixed. Thus, I close this issue.