I've developed a Java dynamic web project correctly deployed on Apache Tomcat. Now I'm trying to deploy the .war file on WebSphere Application Server 8.5. The enterprise application is correctly created but when I try to reach my application with browser I get the following error:
Error 404: javax.servlet.UnavailableException: SRVE0200E: Servlet [it.foo.simpleapp.SimpleApp]: Could not find required class - class java.lang.ClassNotFoundException: it.foo.simpleapp.SimpleApp
The application is very simple: it should answer with a text/html content when a GET arrives.
I'm pretty sure that .war file is correct but I'm new to WebSphere deploying.
The servlet class is:
@WebServlet("/")
public class SimpleApp extends HttpServlet {
private static final long serialVersionUID = 1L;
public SimpleApp() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().print("<html><body><h1>SimpleApp servlet ready!</h1>");
response.getWriter().print("</body></html>");
response.setContentType("text/html");
}
}
The web.xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>SimpleApp</display-name>
</web-app>
Thanks in advance!