File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem running servlets on tomcat

 
Joyce Derzaph
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble running any servlets that I've made on Tomcat. I think it may be a class path problem but I'm not sure.
Its with simple post forms. When I hit the submint button this is what tomcat tells me:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.ClassCastException
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:416)
org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.

Yet everything complies fine outside of tomcat.

Any suggestions anyone! Would posting the stack trace help?
Thanks,

Joyce
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

All sorts of bizarre things can happen when you rely on the invoker servlet. MUCH better to bite the bullet and define your servlet properly in web.xml.
See the JavaRanch FAQ entry for the invoker.
Note that Tomcat totally ignores your environment CLASSPATH - see the "Class Loader how-to" page that got installed with your Tomcat to understand where Tomcat looks for classes.

Bill
 
Joyce Derzaph
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, taht got rid of the errors. Now it just tells me the requested resource is not available.
Any ideas for that one?

Joyce
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably there is some error in your web.xml so that the URL you are using is not getting translated to the servlet name. Note that web.xml is picky about the order of elements.
You really should have a copy of the Servlet API for the definitive explanation of web.xml contents. Download from this Sun web page.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic