am trying to run servlet in WSAD and am getting Error 404: File not found: loadservlet .The actual application is am calling ejb from servlet and trying to run it thru WSAD TEST SERVER.
Once you've changed your display name we're going to need a bit more information than that. A good start would be the relevant section of your web.xml file where you define your servlet and its mapping, the location of your servlet class file, plus the URL that you're using to access it. The server appears to be trying to tell you that, for whatever reason, it can't find your servlet.
Jules
Parka Teoh
Ranch Hand
Joined: Aug 28, 2004
Posts: 40
posted
0
I have a similar problem. The error message is as below..
------------------------------------------------------------------------------ description The requested resource (/servlets-examples/servlet/HelloWorldExample) is not available. -----------------------------------------------------------------------------
I used the demo class file ("http://localhost:8080/servlets-examples/servlet/HelloWorldExample") and it worked.
When I amended and recompiled, it worked too.
However, when I create a new source file, it doesn't work. I tried it in school and it work. But on my home pc, it doesn't. I put the file in ("C:\Tomcat5\webapps\servlets-examples\WEB-INF\classes"), which is the same folder the demos are in.
Do you have a parka?<br /> <br /><a href="http://sg.geocities.com/inschooool" target="_blank" rel="nofollow">Visit my homepage</a> | <a href="http://parka.deviantart.com/" target="_blank" rel="nofollow">Parka Deviantart gallery</a>
Parka Teoh
Ranch Hand
Joined: Aug 28, 2004
Posts: 40
posted
0
I get the following error when I use Textpad to compile. But no errors when I use MSDOS (obviously was hidden).
Parka (you'll also need to change your display name as was indicated to "Rami" earlier in this thread),
Your compile error appears to be due to the TextPad using a different classpath to that found in the %CLASSPATH% environment variable in "MSDOS". The classpath is missing your servlet JAR file - the name varies depending on the servlet container you're using.
As for your strange servlet behaviour, I'm not sure exactly what you're doing. Can you please explain it again? What URL are you using when you get the error message?
Jules
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12265
1
posted
0
Two things to watch out for: 1. If you don't put your servlet class in a package you can get hard to interpret errors 2. If your URL uses "/servlet/" as in: http://localhost:8080/servlets-examples/servlet/HelloWorldExample That probably requires the "invoker" servlet - the cause of much confusion and annoyance to new programmers. See the invoker servlet FAQ. Bill
I meant that I recoded the HelloWorldExample to have a background color of black, and recompiled it.
Then I put it back into the same folder as before, "C:\Tomcat5\webapps\servlets-examples\WEB-INF\classes", in this case.
Typed "http://localhost:8080/servlets-examples/servlet/HelloWorldExample" in the address bar...
And it works. The page turned black.
However, when I put another class file I did back in school into this folder, it couldn't work. It showed me the 404 error.
Parka
Parka Teoh
Ranch Hand
Joined: Aug 28, 2004
Posts: 40
posted
0
Originally posted by William Brogden: Two things to watch out for: 1. If you don't put your servlet class in a package you can get hard to interpret errors 2. If your URL uses "/servlet/" as in: http://localhost:8080/servlets-examples/servlet/HelloWorldExample That probably requires the "invoker" servlet - the cause of much confusion and annoyance to new programmers. See the invoker servlet FAQ. Bill
Thanks for the help.
I followed the FAQ but it couldn't work for me.
I tried changing the "conf/web.xml" file but I can't start my Tomcat server as a result.
I've also edited "WEB-INF/web.xml" file. But I was shown the following error. (code 505)
--------------------------------------------------------------------------- ption The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.util.MissingResourceException: Can't find bundle for base name LocalStrings, locale en java.util.ResourceBundle.throwMissingResourceException(Unknown Source) java.util.ResourceBundle.getBundleImpl(Unknown Source) java.util.ResourceBundle.getBundle(Unknown Source) HelloWorldExample.doGet(HelloWorldExample.java:39) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
---------------------------------------------------------------------------- [ August 29, 2004: Message edited by: Parka ]
Julian Kennedy
Ranch Hand
Joined: Aug 02, 2004
Posts: 823
posted
0
Parka,
It's not much use giving the full details for the case that *does* work. You need to give the full details for the case that *doesn't* work so we can see what you're doing wrong.
Which directory are you putting the class file you did in school in? Does it have a package? What URL are you using to access it? If you're using the InvokerServlet then if you get the URL and the path right I can't see why it wouldn't work (with a 404).