Skip to Content
0

Could not access Java servlet on SAP Cloud Platform

Apr 22 at 07:49 PM

48

avatar image

I'm trying to create a Java servlet in Eclipse that is deployed to SAP Cloud Platform (SCP), servlet connects to a on-premise backend system following this tutorial [1]. I have setup a local sample app simulating a backend server and exposed using Tomcat following this tutorial [2]. I am trying to run the app in Eclipse using Run As -> the SCP account but I'm getting 404 not found error.

My SCC mapping is all green..

And my Destination in SCP and in Eclipse are correctly configured.

Expected output is below.. It works if I run the app directly in local:

Please help me.. I'm on my 16th hr and still cannot solve it. :(

[1] https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/474eae1b69c9434b9dce0314b8d2b6b1.html

[2] https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/e59dc589bb57101480939e290c55e680.html

scc.png (77.6 kB)
dest.png (22.0 kB)
tom.png (6.0 kB)
404.png (35.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Antal Perger
Apr 23 at 03:02 PM
2

Hi Michael,

Have you created an HTTP destination in cloud platform?

Does the cloud connector connects to the same account?

Is there any location ID configured?

Could you check if the HTTP destination can reach the backend system from cloud platform?

If the HTTP destination connection check is fine, I suggest increasing the trace level in cloud connector to All and setting the payload trace flag to see the communication between backend and cloud.

Best regards,

Antal

Share
10 |10000 characters needed characters left characters exceeded
Ivan Mirisola
May 07 at 09:52 PM
0

Hi Michael,

Step 5 doesn't tell you to edit the destination on Eclipse. It tells you to create the destination on the cloud cockpit. You could maintain the destination via Eclipse and import the file (it is a file that can be found under on your workspace under project named "servers" --> tomcat<version> --> destinations). This is a simple flat file containing the same parameters as documented on step 5. Once you import this file via Cockpit, you should be able to use your application.

Another issue you might have is that on SCP, your application will run under a context - which has the same name as the WAR file. Which is kind of confusing at first, because it already has the name of your app added to the hostname. But that's how it is.

So, your URL might need some tweaking to add the application context name and then the servlet mapping - which in case of the exercise is "/". On a localhost machine you don't have that application context.

In order to use the "/" just like on localhost, you will need to rename the WAR file to ROOT.WAR. This will prevent SCP from creating an application context and the URL will be just the same as on your localhost.

Regards,
Ivan

Share
10 |10000 characters needed characters left characters exceeded