Link to home
Start Free TrialLog in
Avatar of pointi
pointi

asked on

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
Avatar of heyhey_
heyhey_

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:
servlet.Link.code=Link
servlet.Link.initargs=\
                           file=/tmp/filename.txt

Avatar of pointi

ASKER

Edited text of question.
Avatar of pointi

ASKER

Edited text of question.
Avatar of pointi

ASKER

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 ?
ASKER CERTIFIED SOLUTION
Avatar of Veena85
Veena85

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial