0

I have a Java web application that is deployed on Azure. The app has several endpoints, one of which accepts a POST request together with an image as input. This endpoint works perfectly when I run it on localhost, however it gives me the following error when deployed on Azure:

The specified CGI application encountered an error and the server terminated the process.

The HTTP status code for this response is 502 Bad Gateway.

The logs under /LogFiles/ do not tell me anything about the cause of the problem. I see some exceptions, but my application handles with ease using a mechanism that catches any uncaught exceptions before they can crash the application, and sends the exception message back as a response, in a JSON format. So the fact that the response I'm getting being something entirely different than the ones my exception handler generates is also really confusing.

Edit: I'm deploying my app using a separate Bitbucket repo, which only includes webapps/ROOT.war in it. When I update the ROOT.war file with my new build, Jetty automatically deploys the new build. I'm not using a web.config file, and I'm not sure where I would put it in my context (a Java web app deployed as a .war file) as the tutorials I've seen do not mention this.

Also, one thing I've noticed when I connect to my server via FTP is that ROOT.war file lies under wwwroot/webapps/ directory, but I can't see the actual deployed app, which, I believe, should reside in wwwroot/webapps/ROOT/.

halileohalilei
  • 2,220
  • 2
  • 25
  • 52
  • It seems that you have deployed your Java web app on Azure within Jetty server. Could you post more details about how to deploy it & the content of `web.config` file for helping us analyze the issue? Or you can refer to some resources like the [tutorial](https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-java-custom-upload) or [the similar SO thread](http://stackoverflow.com/questions/33645242/the-specified-cgi-application-encountered-an-error-and-the-server-terminated-the) to solve it byself. – Peter Pan Mar 08 '17 at 06:33
  • @PeterPan-MSFT thanks, please see my edit above. – halileohalilei Mar 08 '17 at 09:17

0 Answers0