aspose file tools*
The moose likes Tomcat and the fly likes problem running servlets on tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "problem running servlets on tomcat" Watch "problem running servlets on tomcat" New topic
Author

problem running servlets on tomcat

Joyce Derzaph
Greenhorn

Joined: Mar 18, 2004
Posts: 14
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

Joined: Mar 22, 2000
Posts: 12835
    
    5

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

Joined: Mar 18, 2004
Posts: 14
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

Joined: Mar 22, 2000
Posts: 12835
    
    5
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
 
subject: problem running servlets on tomcat