cancel
Showing results for 
Search instead for 
Did you mean: 

Getting 500 error on MDK Application after deployed on cloud foundry

CRVMANISH
Contributor
1,468

Hello Experts, I have created a MDK demo app using WebIde tried to deploy on cloud and mobile service so. Getting below error after deployment on cloud. Please check the below screenshot.

mdk-error.pngFailed to initialize application data service - Error: 500 (); GET /com.sap.edm.sampleservice.v2/?sap-language=en <html><head><title>Error report</title></head><body><h1>HTTP Status 500 - An internal application error occurred. Request: ****mdk-error.png:demoapp</h1></body></html>

View Entire Topic
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

From SAP Web IDE, you can deploy the MDK metadata to both Mobile Services NEO and Mobile Services Cloud Foundry to run it in MDK mobile client but for web, you can deploy to BTP Neo only to run it as web application. In the BTP Neo cockpit, you might not be able to connect to Sample backend from Mobile Services CF due to some security/authentication challenges.


In your case,you need to configure a cloud destination in BTP Neo cockpit connecting to Sample backend from Mobile Services Neo.

If you look at the error, you can see that your MDK web application is trying to connect to com.sap.edm.sampleservice.v2 destination during app initialize (look at Error 500 GET/com.sap.edm.sampleservice.v2..) and since it didn't find, it failed. You can double check it in BTP Neo cockpit.
You might have created a MDK project connecting to Mobile Service source Type and might have selected the com.sap.edm.sampleservice.v2 destination and would have deployed the project to Web. If you try to create a new destination com.sap.edm.sampleservice.v2 in the BTP Neo cockpit, it won't allow because cloud destination doesn't support period in it's name. (But Mobile services destination does, you might have already tested your MDK app running in mobile client connecting to the default sample backend destination)

To solve this problem, you can follow below approach -

  • In the Mobile services Neo cockpit> navigate to your application > Connectivity>copy the URL of the sample backend
  • Create a new destination, provide a name e.g. SampleServiceV2 (don't use any period in it), enter the copied URL, select Application-to-Application SSO in the SSO mechanism. (Perform the OData application test to check if you can see the data for this new destination)
  • Navigate to BTP Neo cockpit >Connectivity> Destinations
  • Create a new destination, provide the same name e.g. SampleServiceV2, enter the copied URL (from 1st step), Proxy type: internet, authentication:App2AppSSO, add these 3 properties
  • Log off from WebIDE and login again.
  • Navigate to .service file in your MDK metadata project > select the Destination Name SampleServiceV2 (click Refresh Objects to check if editor is able to fetch the service metadata for the new destination).
  • Re-deploy to Web application and it should work now. (you might need to clear the browser cache/cookies if required)


Hope this helps.

P.S. If you already have a Cloud Foundry account, i recommend you to use BAS for any MDK development.

Ayush
Explorer
0 Kudos

Hi Jitendra Kansal,

do we need to follow same steps in CF environment also, it seems above steps are for Neo environment

for CF environment do we need to follow other steps.

In my case i want to consume S4hana on premise into SAP MDK web app but i am getting below error(snippet)

webapp.jpg

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

ayush0401 Please open a new question so you can provide specific details related to your scenario and so it will get better visibility.