0

Whenever I want to run a servlet from eclipse on Tomcat7.0 the server start up gets failed. I have been practising jsp and servlet from a week, everything was going fine till this morning , suddenly my system gets shut down unexpectedly from then I am facing this issue. I tried all the possible ways like deleting the server and creating a new one etc. but finally This instruction helps me

 You need to copy the required commons jars into your /WEB-INF/lib folder as well.

commons-io-2.4.jar
commons-fileupload-1.3.1.jar
The reason is that just adding the jar dependencies to your Eclipse project's build path does not make them automatically available on Tomcat. Since, the dependencies are missing (not found in the lib folder) your web app's deployment fails.

Still I have a problem and a question.The question is, do I have to add the above mentioned two Jar files in all my project's /WEB-INF/lib folder? and The problem is though my server runs without any errors it fails to run the servlet file. I get this error. it happens only with servlet, there is no issue with jsp or html file.I have tried by creating more than three new projects to test but the result was same as below.

HTTP Status 404 - /Register

--------------------------------------------------------------------------------

type Status report

message /Register

description The requested resource is not available.
Community
  • 1
  • 1
Saddam Hussain
  • 146
  • 1
  • 6
  • You searched using the wrong keywords. Is this acceptable as dupe? http://stackoverflow.com/questions/11731377/how-to-call-servlet-from-html-form-in-jsp-file-without-getting-http-404-error – BalusC Sep 01 '15 at 17:38

1 Answers1

0

Add the listed jar-files (commons-io-2.4.jar and commons-fileupload-1.3.1.jar) into the project's WEB-INF/lib-folder (if it doesn't exist, create the folder). The reason why you get the error in only that servlet is probably because you run code from the jar-files in that particular servlet.