• 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
servlet.lin.code=link

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
servlet.foo.code=fooservlet
servlet.bar.code=barservlet

Please help me in this regard
0
pointi
Asked:
pointi
1 Solution
 
heyhey_Commented:
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.
0
 
conickCommented:
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:
servlet.Link.code=Link
servlet.Link.initargs=\
                           file=/tmp/filename.txt

0
 
pointiAuthor Commented:
Edited text of question.
0
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.
0
 
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!!!!!!
0
 
heyhey_Commented:
browser caching ?
0
 
heyhey_Commented:
or better - restart the server ?
0
 
Veena85Commented:
well restarting the server didn't work out
0

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