cancel
Showing results for 
Search instead for 
Did you mean: 

Access Java Servlet on deployed on SCP

Former Member
0 Kudos

Hi,

I have created a Java servlet "hello world" application. It has no errors deploying, it runs fine on the cloud platform but calling the end points give me a 404. Why?

The code:

Servlet("/hello")
public class HelloWorldServlet extends HttpServlet {

    private static final long serialVersionUID = 1L;
    public HelloWorldServlet() {
        super();
    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	response.getWriter().println("Hello World!");
    }
}

The application is running:

The log tells me none of the endpoints are found:

Accepted Solutions (0)

Answers (1)

Answers (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jorg,

If you are using the SDK on Eclipe select the deployed application on the Cloud server and right-click on it. Then open the menu URL --> Open. This will launch the browser with the correct URL pointing to the application's context.

SCP uses the application name used during deploy to establish the prefix for it like <app_name><account_id>.hana.ondemand.com.

*HOWEVER*, it uses the WAR name to deploy it in a "context". In that sense, if the file name used to deploy is jcoproxy.war it will create a context named jcoproxy. With that said, you app servlet will be behind this context like this:

https://jcoproxyS00---xxxx---.hanatrial.ondemand.com/jcoproxy/hello

If you wish to deploy your app at the context root, then you need to rename the war file as ROOT.WAR. This will place your app so that the URL will be:

https://jcoproxyS00---xxxx---.hanatrial.ondemand.com/hello

Regards,
Ivan