• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • Last Modified:

Common error found in java servlets

Hi ,
I am using simple DOS  editor & classpath i have given it as c:\javawebserver1.1.3\lib\jws.jar
& path as c:\javawebserver1.1.3\bin.
I had registered my servlet also in servlet.properties as

But today morning when i did run that link servlet i got the output without making any changes.
And i wrote new servlet fooservlet.java from where i am calling method defined in barservlet.java.
In barservlet.java im implementing the interface BarInterface.This BarInterface has been defined
as public & stored as BarInterface.java in a separate file where i have defined bar() method which is
defined in barservlet.java.Every thing is compiled normally.But when I did run the servlet again
following error is occured.

Not Found (404)

The file that you requested could not be found on this server. If you provided the URL, please check
to ensure that it is correct. If you followed a hypermedia link, please notify the administrator of that
server of this error.

I did shut down the system & restarted again.Then again i did run fooservlet .
Now it is giving following error
Document contains no data Try again later or contact the server administrator later .

I dont know what the hell is going on.I wonder Once it gives 404 Not Found & some other time
it gives document contains no data some other time i am getting the output without making
any changes!!!.

I am unable  to figure out what is the root of the problem.Coz everything is fine,classpath,path,in
servlet.properties file i have registered both fooservlet.java & barservlet.java as follows

Please help me in this regard
1 Solution
what is your 'servlet runner' enviroment ?
probably you haven't 'register' this servlet...
or not in classpath ...
or does not extend any servlet class ...

check your 'servlet runner' logs if you can.
To elaborate on what heyhey said:
Different servers have different ways of "registering" servlets.
For servletrunner you need to register it with a file called servlet.properties
You would put something like this in it:

pointiAuthor Commented:
Edited text of question.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

pointiAuthor Commented:
Edited text of question.
pointiAuthor Commented:
I am using javawebserver1.1.3 & i also registered servlet in servlet.properties as u said.Even then it was giving  404 Not FOund Error.Now it is working fine ,but facing the same kind of problem in new servlet!!!!!!
browser caching ?
or better - restart the server ?
well restarting the server didn't work out

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now