cancel
Showing results for 
Search instead for 
Did you mean: 

404 error when trying to call Servlet on deployed Java Service

t_stelzer
Discoverer
0 Kudos

Hello Community,

I'm developing a Java Service for the Sap Cloud Platform. It has a Servlet which overrides the doGet-Method and the doPost-Method. The Java Service is deployed on SCP.

I want to call this Servlet by making GET and POST-Requests from a SAPUI5 application to the Service. The SAPUI5 application is developed with the WebIDE and then also deployed on SCP. When starting the SAPUI5 application from the WebIDE its GET- and POST-Requests actually reach the Servlet on the deployed Java Service and everything works as intended, however after I deploy the SAPUI5 application to SCP and run it from there it receives a 404 error when making the GET-Request and a 405 error (Method not allowed) when making the POST-Request.

I have created a destination on SCP which points to the Java Service URL and use it in neo-app.json of the SAPUI5 application.

Any ideas why it works from the WebIDE but won't work after deployment?

Edit (additional information):

The requests are done by a sap.m.UploadCollection-Control (the Url is set in the uploadUrl attribute):

<UploadCollection id="UploadCollection" uploadUrl="/MyService/attachments/" ...>

Entry in neo-app.json:

{
	"path": "/MyService/attachments/",
	"target": {
		"type": "destination",
		"name": "MyService_Attachments"
	},
	"description": "MyService Attachments"
}

Destination Configuration in SCP Cockpit:

Name: MyService_Attachments
Type: HTTP
Description: MyService Attachments
URL: https://<JavaApplication><AccountName>.hana.ondemand.com/MyService/attachments
Proxy Type: Internet
Authentication: AppToAppSSO

<- Additional Properties ->
TrustAll: true
WebIDEEnabled: true
WebIDESystem: My Service

Accepted Solutions (0)

Answers (1)

Answers (1)

t_stelzer
Discoverer
0 Kudos

I just found the problem and fixed it.

The app which accesses the Servlet is placed inside a Launchpad app which will open the app (and other apps).

After deployment of the individual apps the 'neo-app.json' of the Launchpad app is used, so I just had to define my Destination in there as well.