Gregory Mazur Gregory Mazur - 15 days ago 5
Java Question

Servlet cannot be resolved in web.xml

For some reason idea lights dispatcher servlet and when I launch tomcat get the 404 error. I`m using spring mvc and Maven, here is the picture of web.xml web.xml
Appreciate every answer=)
webapp/web.xml

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>

Answer

Found the problem, was using the tomcat7-maven-plugin with compile version of maven-compiler-plugin 1.8, after changing it to 1.7 the problem gone. However is there any similar solutions to tomcat7-maven-plugin?, cause I didnt find tomcat8-maven-plugin in internet

Thanks everyone for participation