The following stacktrace is what I get when i try to access a servlet, which seems running fine from Tomcat manager.
11 Sep, 2012 11:50:12 AM org.apache.catalin
Somehow you are missing the servlet-api.jar
. It should be located in the tomcat\lib
folder.
After looking into the Exceptions, you got, some where you have misplaced the jar files
(servlet-api.jar). It should be under your Project/WEB-INF/lib folder. I think it will
works if your jar files are in the path specified above.
If you get this error "SEVERE: Allocate exception for servlet" coupled with a "java.lang.InstantiationException" exception, make sure that your servlet class has a public no-argument constructor since the servlet container needs to be able to instantiate it.
If your servlet class does not have an explicit non-zero argument constructor defined (which is usually the case), the default constructor provided by the compiler would suffice.
"java.lang.Error: Unresolved compilation problems
: "
says that application is not compiled properly. Please put the servlet-api.jar
in classpath, not just in lib folder of project, but also attach that to classpath.
Please make sure that same jar also available in tomcat/common/lib
folder.
I had the same problem! Spent 2 hours searching for solution! And here it is!
WebContent (under Dynamic Web Project) -> WEB-INF -> lib (it's empty- all right) -> right click on it (lib) -> Build Path -> Use as Source Folder.
DONE!