sapmentors / cap-community

SAP CAP Community
MIT License
97 stars 26 forks source link

SAP Fiori launchpad module in CAP project #72

Closed shyamkumarc closed 4 years ago

shyamkumarc commented 4 years ago

Hi I'm using WebIDE for my development - SAP business application project in WebIDE.

I am having issues getting the fiori launchpad to work in the CAP project . Every other module is working fine . But when i add a FLP module and deploy the project - even though the project deployment completes successfully, the approuter will shown an internal server error when it redirects to the FLP module .

https://XXXXXXXX.cfapps.eu10.hana.ondemand.com/cp.portal/site -> Gives internal server error.

here is my project: https://github.com/shyamkumarc/CAP-POC

Im attaching the CF deploy logs here in case that helps. CAP_POC1-db.log CAP_POC1-srv.log cap-poc1-approuter.log flp1.log OPERATION.log CAP_POC1_ui_deployer.log

gregorwolf commented 4 years ago

I would suggest that you checkout the mta.yaml of SHINE for Cloud Foundry.

shyamkumarc commented 4 years ago

Hi All,

I was able to fix the issue. Sharing the answer here so that it'd be of help for someone who encounters the same issue.

Am mentioned above, I was using WebIDE full stack for my development and the template for creating a CAP project is using the "SAP cloud platform business application" project. I noticed some flaws in this template which were causing the issue.

  1. The SCP business application template doesn't seem to be defining the scope uaa.user in the XS-security file when a project is created .

2.The XS-security file doesn't get linked with the XSUAA resource when a project gets created.

I went ahead and fixed both the above points and now I'm able to get the FLP instance working. I'm not sure if the above 2 were conscious decisions based on some thought , or just a miss from the relevant team's end .

Fixes to be made:

XS-security file: Add a scopes section , after the description section in the XS security file as follows.

"scopes":[ { "name": "uaa.user", "description": "UAA" }],

MTA file:

Add the path to XS-security file on XSUAA resource in your MTA file _resources: -name: type: org.cloudfoundry.managed-service parameters: path: ./xs-security.json service-plan: application_

Apart from that , if your deployment fails and the log shows error : "Upload application content failed { CODE: '1001' } validation error: Error while parsing request; Error: maximum file length exceeded" , you may refer to the following note regarding fixing the HTML application repo host memory :

https://launchpad.support.sap.com/#/notes/0002764058

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/b8343d9d8b984d73adbae5fe657f13db.html