Discussions

I am trying to upload a file on Apache2.2.3 - mod_jk/1.2.19 - Tomcat5.5.20
On form submit, it's posted to http://www.knobe.org/Fupload/servlet/UServlet
httpd of Apache is having the line
JkMount /Fupload/* example
webapps/Fupload/WEB-INF/web.xml is having the entry
UServlet
UServlet
UServlet
/servlet/UServlet
The UServlet.class is in folder webapps/Fupload/WEB-INF/classes/
The conf/server.xml is having the entry
First time on Tomcat resart i am getting the error...
exception
javax.servlet.ServletException: Class UploadServlet is not a Servlet
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)........
and subsequent error msge
404 error - 'Servlet UServlet is not available'.
http://www.knobe.org/servlers-example/ and
http://www.knobe.org/jsp-examples/ are working fine.
and this servlet worked only once - when i first installed the Tomcat.
What could be the reason? What other enteries do i need?
Pl help. Thanks
ben

In the web.xml the name of the servlet class is UServlet but the name of the class is not UServlet it is UploadServlet.
When i say the full name i mean the following:
com.blah.blah.UploadServlet
Thanks

Hello
Even after spelling correction, the error occurs...
If the Tomcat is restarted error 500 is displayed -
Saying 'UploadServlet is not a servlet'
If i call the servlet again, then the 404 is displayed.
httpd of Apache is having the line
JkMount /FileUpload/* example
webapps/FileUpload/WEB-INF/web.xml is having the entry
UploadServlet
UploadServlet
UServlet
/servlet/UploadServlet
The UploadServlet.class is in folder webapps/FileUpload/WEB-INF/classes/
The conf/server.xml is having the entry
Even with /servlet/UploadServlet in web.xml, it should work.
In fact it worked only once - the first time - after Tomcat installation.
rgds

Hello
Yes. I saw that spell error. If its a spell error it gives 404 Error msg.
But then even after correction i am getting the same error msg - 'UploadServlet is not a servlet'.In fact even a simple 'Hello World' servlet is giving the same error.
Any ideas?
rgds

A couple of things you could try:
1) Re-install Tomcat
2) Install JBoss application server and deploy your servlet to the app server.
I can't see anything wrong with the web.xml and the servlet class. Your extending HttpServlet and you've mapped the servlet. This is probably a stupid suggestion but are you typing /servlet/UploadServlet to the url? How are you accessing the servlet?

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.