How can I debug Servlet under Eclipse IDE?
I use Eclipse with Tomcat plugin.
How can I debug my servlet?
When I try to call the servlet from Browser, I got error message:
HTTP Status 405 - HTTP method GET is not supported by this URL
--
type Status report
message HTTP method GET is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
I don't run it through Eclipse, but perhaps you can do some simple debugging by System.out.println? If it doesn't write sysout to a console you can read, you should instead check the logs files in the directory /logs in your Tomcat home. Once you see that Tomcat and your servlet is starting up correctly, you should go on to use one of the extensions to JUnit made to test web servers (I think one is called Cactus) to test for correctness and performance.
As for your error, the most likely thing is that you have only overridden the doPost method in your servlet, and your browser is doing a http GET request which causes the container to look for a doGet.
I on the other hand gets the same error message, and I *do* have a doGet method in my servlet. I am currently thinking it may have something to do with the classpath (that it doesn't map the request correctly to the servlet) or maybe permissions (GET calls are blocked). So I will probably have to look through the web.xml and server.xml config files. Joy.
If I find the solution I will post it here...
I am using Eclipse IDE with a plugin for Tomcat. I am writing a simple servlet by creating a tomcat project. I have a web.xml in WEB-INF.
1) I cannot see classes directory under WEB-INF in eclipse ide. Why?
2) I get this message when I try to see my servlet.(http://localhost:8080/DeployApp/org.cookbook.ch11.DeployClass)
HTTP Status 404 - /DeployApp/org.cookbook.ch11.DeployClass
type Status report
message /DeployApp/org.cookbook.ch11.DeployClass
description The requested resource (/DeployApp/org.cookbook.ch11.DeployClass) is not available.
Apache Tomcat/5.0.28
Can somebody help me find what the problem is?
Thanks in advance.
hello ,, even i had the same 405 http problem,,, i used the service method ,,, its workin fine :-)