404 - servlet unavailabe error - help pl


Web tier: servlets, JSP, Web frameworks: 404 - servlet unavailabe error - help pl

  1. 404 - servlet unavailabe error - help pl (9 messages)

    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
  2. Hi Is it possible to paste the servlet class? Also you need to specify the full name of the servlet class in the web.xml definition. Thanks Amin
  3. Hello What do you mean by the full name? And this is the starting code... import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class UploadServlet extends HttpServlet{ public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); uploadDirectory = getServletContext().getRealPath("/WEB-INF/upload"); try { String uploadDirectory = getServletContext().getRealPath("/WEB-INF/upload"); ......
  4. 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
  5. 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
  6. Hi Is this a test app you are working on? If so can you zip the app and send it to my email address? My email is mohammed_coleman at hotmail dot com Thanks
  7. Re: 404 - servlet unavailabe error - help pl[ Go to top ]


    Should'nt your be the same in the and tags? Can you try this?

  8. Re: 404 - servlet unavailabe error - help pl[ Go to top ]

    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
  9. 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?
  10. Hi No. I am not typing the url directly. i have the default page www.knobe.org/html/test.html in which there is this submit btton that liks to http://www.knobe.org/FileUpload/servlet/UploadServlet rgds