on 11-14-2017 11:47 AM
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.