-
404 - servlet unavailabe error - help pl (9 messages)
- Posted by: CS B
- Posted on: October 30 2006 04:35 EST
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 benThreaded Messages (9)
- Re: 404 - servlet unavailabe error - help pl by Amin Mohammed-Coleman on November 01 2006 03:33 EST
- Re: 404 - servlet unavailabe error - help pl by CS B on November 01 2006 05:52 EST
-
Re: 404 - servlet unavailabe error - help pl by Amin Mohammed-Coleman on November 01 2006 09:10 EST
-
Re: 404 - servlet unavailabe error - help pl by CS B on November 02 2006 12:03 EST
- Re: 404 - servlet unavailabe error - help pl by Amin Mohammed-Coleman on November 03 2006 03:42 EST
-
Re: 404 - servlet unavailabe error - help pl by Kedar Dixit on November 06 2006 06:55 EST
-
Re: 404 - servlet unavailabe error - help pl by CS B on November 07 2006 12:22 EST
-
Re: 404 - servlet unavailabe error - help pl by Amin Mohammed-Coleman on November 09 2006 03:54 EST
- Re: 404 - servlet unavailabe error - help pl by CS B on November 14 2006 07:36 EST
-
Re: 404 - servlet unavailabe error - help pl by Amin Mohammed-Coleman on November 09 2006 03:54 EST
-
Re: 404 - servlet unavailabe error - help pl by CS B on November 07 2006 12:22 EST
-
Re: 404 - servlet unavailabe error - help pl by CS B on November 02 2006 12:03 EST
-
Re: 404 - servlet unavailabe error - help pl by Amin Mohammed-Coleman on November 01 2006 09:10 EST
- Re: 404 - servlet unavailabe error - help pl by CS B on November 01 2006 05:52 EST
-
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: Amin Mohammed-Coleman
- Posted on: November 01 2006 03:33 EST
- in response to CS B
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 -
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: CS B
- Posted on: November 01 2006 05:52 EST
- in response to Amin Mohammed-Coleman
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"); ...... -
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: Amin Mohammed-Coleman
- Posted on: November 01 2006 09:10 EST
- in response to CS B
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 -
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: CS B
- Posted on: November 02 2006 00:03 EST
- in response to Amin Mohammed-Coleman
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 -
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: Amin Mohammed-Coleman
- Posted on: November 03 2006 03:42 EST
- in response to CS B
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 -
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: Kedar Dixit
- Posted on: November 06 2006 06:55 EST
- in response to CS B
UploadServlet
UploadServlet
UServlet
/servlet/UploadServlet
Should'nt your be the same in the and tags? Can you try this?
UploadServlet
UploadServlet
UploadServlet
/servlet/UploadServlet
-
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: CS B
- Posted on: November 07 2006 00:22 EST
- in response to Kedar Dixit
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 -
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: Amin Mohammed-Coleman
- Posted on: November 09 2006 03:54 EST
- in response to CS B
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? -
Re: 404 - servlet unavailabe error - help pl[ Go to top ]
- Posted by: CS B
- Posted on: November 14 2006 07:36 EST
- in response to Amin Mohammed-Coleman
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