Here this is my error when I am trying to run the web.xml
of my project in Eclipse.
This is the main error that I am facing when I am trying to run the
If you have deployed libraries for the javax.servlet
which is part of the JavaEE package then you have made a mistake, the web server already contains those libraries and loads corresponding to your servlet specification API.
(It worked in my case) This is also one of the case where it works, Go to Windows->ShowView->Servers. Expand Tomcat(for an e.g)-> delete the concerned jar Rebuild the project.
To this condition to work solution given by @Rishi Gautam should be true.
If you have imported someone else's project in Eclipse then remove and add servlet-api.jar
in classpath as the path of servlet-api.jar could be different on your system.
After that clean the project and run again.
Check all the Jars are properly Configured or not. Clean the Eclipse server. Clean Tomcat Working Directory. Go to Menu Project -> Clean. Restart the server and Application.
If you have configured and built project properly with all required jars and still getting same error then you might missed to create classes folder. If we are using existing project setup and configuring it, then default output folder should be entered manually as per project requirement. In my case, eclipse was giving default output folder to /bin but it was configured to project_name/WEB-INF/classes. So I have changed it to project_name/WEB-INF/classes
The servlet-api.jar
is not on your classpath. Check in your servlet container's lib
folder. If you are using Tomcat, that'll typically be in C:/apache-tomcat-7.XX/lib
. If it isn't there, download it and add it.
The Tomcat Servlet API jar is available here.