Basically, I\'ve written a springMVC
application (with a relatively shotgun my way first-timer approach with regards to Spring). The project works fine on Tomc
This is what i have been facing for long time.
This happened last time and figured out that one case could be a bad war deployment, which came after i update library/maven dependencies on pom and re installed it.
SOLUTION:
right click on the server > remove the war and
right click on the server again > clean
make sure the maven dependencies are added to deployment assembly
right click on the project > Run As > maven clean
right click on the project again > Run As > maven install
and finally deploy the project on to the server. This helped me to solve the issue
I solved a similar problem by updating the web.xml
declaration to Servlet 4.0 specification as follows (I use Tomcat 9) :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
metadata-complete="true">
<!-- ... (your content here) ... -->
</web-app>
You can check which servlet version Tomcat supports by refering to the chart on Tomcat's which version page.
for me one case was I just missed to maven update project which caused the same issue
maven update project and try if you see any errors in POM.xml
"there is no problem with tomcat".
I have suffered 4-5 days to resolve the issue (same issue mentioned above). here i was using tomcat 8.5. Finally, the issue got resolved, the issue was with the "Corrupted jar files". You have to delete all your .m2 repository (for me C:\Users\Bandham.m2\repository). den run "mvn clean install" command from your project folder.
happy coding.
Give one UP if it is solved your problem.
I have faced a similar problem, but it consoles the error like an encoding issue. After changing the IDE encoding, it works fine.
you can fix it with:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet-api-version}</version>
<scope>provided</scope>
</dependency>
provided solves this problem