This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I don't know how, but I solved the problem. I just re created the servlet from scratch adding one bit of functionality and one external jar at a time and lo and behold it worked. I swear I didn't change anything in the web.xml file. I apologize for the time I took from some of you.
I am trying to access a servlet from a Java application
and it works fine. Initially, the web application was created with index.jsp specified in the web.xml and my request was running the JSP; so Tomcat is running my war. I think that my client code is correct, but I have to do something in web.xml. In the client I have tried all combinations of PaperlessOffice, Paperless and servlet to no avail.
I just don't getit.
I am using "serverAddress = new URL("http://localhost:8080/Paperless/servlet/Paperless/");" the idea is to invoke the url-pattern "servlet/Paperless" in the war file "Paperless".
I am using
in my web.xml file. It associates the url pattern "servlet/Paperless" with the name "Paperless". In the servlet tag this name is associated with class com.paperless.Paperless. This class exists in WEB-INF/classes. It should find this calls, but I am getting a 404 error in the tomcat log which tells me thta the resource is not found and In Java I get "java.io.FileNotFoundException: http://localhost:8080/Paperless/servlet/Paperless/".
When I use "serverAddress = new URL("http://localhost:8080/Paperless/" )"I get the text of the index.jsp file in <welcome-file> in web.xml, so "http://localhost:8080/Paperless/" is a web address (I should know that because 404 means that the request was received).
I am getting the same error with Tomcat and GlassFish. I don't know what I am doing wrong in the web.xml file. I really need the help of an expert.
Have you looked at the logs to see if the servlet wasn't able to be deployed?
Joined: Aug 01, 2005
Thank you Ben. I haven't seen anything in the Tomcat or GlassFish logs. But on GlassFish I just saw "[#|2011-05-12T12:46:02.684-0400|INFO|oracle-glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=193;_ThreadName=Thread-1;|PaperlessOfice was successfully deployed in 316 milliseconds.|#]
But I am still having the same error with "serverAddress = new URL("http://localhost:8080/Paperless/paperless");". Using