cancel
Showing results for 
Search instead for 
Did you mean: 

OData call 404 when running from HCP

amber_garg
Active Participant
0 Kudos

I have created a fiori app in eclipse which uses an odata url from a ecc server. It works fine when i test it locally in the browser. When i deployed it to HCP from eclipse using GIT and executed in browser , i can see my fiori app coming but the Odata call is failiing. I can see in the network tab the status 404 not found for $metadata for the odata service. BTW I am using proxy/http  in the url which is working fine when testing locally in browser.


Is there anything else , I need to do to make the odata call work when app is deployed in HCP. I read about reverse proxy by creating destination in HCP , i tried it myself to create it but I am unable to do . Can someone kindly tell me the steps so that I can successfully execute my odata call(from an ECC server) from HCP too

I had posted this question in HCP section too around 24 hrs back but there are hardly any views there hence I am posting it here.

Regards

Amber

Accepted Solutions (0)

Answers (3)

Answers (3)

GregTutt
Explorer
0 Kudos

Hey Amber,

Can you please share with us the neo-app.json file that should be in your root ? This is where you will define what are the destinations your application will use.

Normally in the cockpit, you should also see all the destinations that are currently defined in the file and to which you can map a destination that you define in HCP.

Dont worry, we will find a solution

Cheers

Greg

amber_garg
Active Participant
0 Kudos

Hi Gregory,

Thanks very much for your help.  What i understood is that neo-app.json file can be seen only from WEB-IDE and not through eclipse. So i opened the corresponding application in web-ide but strangely there is no neo-app.json file in the folder . I think I am going terribly wrong somewhere . Please find the screenshot below

GregTutt
Explorer
0 Kudos

Hey Amber,

Actually you can see it in eclipse also if you open the Git view. You'll find the file under the Working Directory. I usually create the file in Eclipse by saving it in the root folder (but it is not visible) of my project but you can also create it in the WebIde.

This is a sample of a git view where you can see the file.

Regards

Greg

amber_garg
Active Participant
0 Kudos

Hi Gregory,

Actually in my GIT view of eclipse also , its not showing any neo-app.json file. Actually I have followed the steps as given in to deploy my application in HCP. According to this document also , there is no neo-app.json file created . Is there any other way I need to deploy/create in eclipse.

amber_garg
Active Participant
0 Kudos

Hi Gregory,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d012de0f-9c52-3110-aebb-8a9d9aaae...

My HCP runtime creation issue was solved so now I am back to create destination and resolve my reverse proxy error in eclipse before deploying to HCP. As per the above document , I did the steps of modifying the web.xml with additional code for reverse proxy as seen in screenshot below

I have created the destination also with the name "cloudbackend" as given in the document.

In my Odata model , as given in the document i modified the url for webservice by using the destination name.

But when I am executing this app from eclipse using local HCP runtime (not HANA cloud platform yet) , its giving 404 Not Found for this URL while fetching the $metadata itself which means the destination does'nt seem to work.

Also , in the document , its written to add 2 java files ProxyServlet.java and SecurityHandler.java in  a package inside the src folder of JAVA Resources. I did that but the ProxyServlet.java files are been shown in red color in eclipse indicating some error in them on some lines ("import javax.servlet.ServletConfig")

Once this app is able to successfully run ODATA call using destination from localhost HCP in eclipse , I guess then I will deploy to actual HANA Cloud Platform and expect it to work.

Regards

Amber

amber_garg
Active Participant
0 Kudos

Hi all ,

There is some improvement now. I am able to run the application with destination proxy using HANA cloud runtime server in eclipse (locally). You can see the screenshot below its showing successfull status now for the odata webservice call with proxy destination "cloudbackend" which I created in HCP runtime of eclipse locally.

But when I deploy the same application to Hana Cloud Platform and create the destination "cloudbackend" in DESTINATIONS option in HCP server with the same settings as I did in eclipse , there I am still getting 404 error for the $metadata of odata service. Please find the screenshot below.

I guess I am very close now since now its working perfectly fine with the Local HCP server of eclipse using the proxy destination. Just i need to get it work with the actual HCP the same way. Any help would be appreciated

amber_garg
Active Participant
0 Kudos

Finally got the issue to get resolved. Now my fiori app is working perfectly fine on both localhost HCP runtime in eclipse as well as the Hana Cloud Platform on the net . The odata webservice is also returning data successfully.

There was some issue with some jar files missing required for reverse Proxy destination used for running Odata web url in HCP. Once I added those JAR files in build path , it started working.

Thanks a lot everyone who tried to help me out.

Regards

amber_garg
Active Participant
0 Kudos

Hi all ,

I am following this document to set up the HCP in eclipse , as the first step to solve this reverse proxy problem. I have installed the required tools in eclipse related to HCP as given in this document. But when I go to Windows->Preferences->Server->Runtime Environment , according to this document I should see a Hana Cloud Platform runtime environment in the list to select. But in my eclipse I am getting only java options . Please find the screenshots.

There is no Hana Cloud Runtime option under SAP.

But according to PDF , it should be like below

I have installed the related HCP components in eclipse as follows.

Regards

Amber

amber_garg
Active Participant
0 Kudos

Just to add -  I am on Windows 7 . (I saw other threads where the same problem was coming in Windows 😎

SergioG_TX
Active Contributor
0 Kudos

hi Amber, have you enabled the HCP cloud connector on your HCP account? have you set all all the proxy settings correctly? it seems that if it works locally but not from HCP is an issue w the proxy as HCP will require this proxy in order to serve your OData plus youneed to look into the cloud connector as well. here is the url for documentation: https://help.hana.ondemand.com/ hope this helps

amber_garg
Active Participant
0 Kudos

Cloud connector is not there yet but as you said with proxy it might work so I wanted to try out the proxy thing first and confirm before moving to cloud connector part.

As per the documentation , I created a HTTP destination in HCP for proxy earlier too , but I dont know which parameters to enter . I entered based on my understanding as follows

Name : OData_PO

Type : HTTP

Description - Odata request for PO

URL : http://<ip add>:<port>/sap/opu/odata/sap/zprj_po_srv/

Proxy Type : Internet

Authentication : NoAuthentication

After this , in my source code i removed the "proxy/" from the URL , and so now my url in source code starts with http instead of proxy.

When i re-deployed the source code to HCP and tested again , this time In network tab of chrome , i dont see any call to the odata service happening at all.

Regards

Amber

amber_garg
Active Participant
0 Kudos

Any suggestions guys? . I am really clueless on the above

Former Member
0 Kudos

Hi Amber,

this is the issue of proxy setting. As the proxy is not set properly you are getting this 404 .

Thanks

amber_garg
Active Participant
0 Kudos

Yes Rabi ,

To solve this proxy issue , people told to create Destination in HCP which I created as above , but still its not working , so I am not able to figure out what is missing and where I am going wrong.

Regards

Amber