This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servlet configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet configuration" Watch "Servlet configuration" New topic
Author

Servlet configuration

Tony Paulino
Greenhorn

Joined: Apr 02, 2006
Posts: 3
I am trying to set up a servlet on my server:
Windows XP
Apache for Windows
Tomcat 5.0.28

After installing Tomcat, I can go to the sample servlet directory and see the HelloWorld servlet at HelloWorldExample. When trying to load my own servlet through an applet at sample game (click the playback image if you want to try), I get an Error reading from servlet: java.io.FileNotFoundException. Further, when I copy the HelloWorld servlet to the folder I set up for my servlet, I get a 404 error - The requested resource [...] is not available. What configuration setting am I missing to get this to work?

I've read where I should not need /servlet/ in my URL, but the sample works that way, and the old server where this worked (which was on a previous version) included that in the URL. I'll fix that later.

Thanks in advance,
Brett


Apparently Brett Paul is already registered.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Your problem could easily be related to the use of /servlet/ in the address. Read this FAQ on the invoker.
Here is the more complete error message I just got:



It looks like your PlaybackApplet could do with some better error trapping and reporting.
Bill
Tony Paulino
Greenhorn

Joined: Apr 02, 2006
Posts: 3
Sweet. Thanks for the reference. I'm now getting a new error when I run it:

Error reading from servlet.
java.io.IOException: Server returned HTTP response code: 500 for URL: http://www.orcsports.com:2001/orcsports/servlet/IOServlet
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at PlaybackApplet.run(PlaybackApplet.java:293)
at java.lang.Thread.run(Unknown Source)
Server returned HTTP response code: 500 for URL: http://www.orcsports.com:2001/orcsports/servlet/IOServlet

I unfortunately need to catch a plane. I will look into that error when I get back next week, but I think it marks progress.

On the error trapping side - I agree. This applet could use a LOT of work. I wrote it something like 7 years ago under 1.0 or 1.1.
Tony Paulino
Greenhorn

Joined: Apr 02, 2006
Posts: 3
The applet/servlet combination is working again. Thanks for your help! (I actually fixed it just before I left for that trip, but am just now getting back to reading stuff again.)
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Thank you for posting back, Tony.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet configuration
 
Similar Threads
Still confused - Tomcat Servlet.xml
Tomcat 5.0.27 Http status 404 Error
Servlets not supported by JBoss???
A Servlet That Uses Packages and Utilities
HTTP Status 404 servlet error ("The requested resource is not available")