*
The moose likes Servlets and the fly likes problem while running servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "problem while running servlet" Watch "problem while running servlet" New topic
Author

problem while running servlet

Kaspar Minosiants
Greenhorn

Joined: Jun 21, 2003
Posts: 13
Hello !
I've installed servlet programming environment recently
Tomcat 1.4
eclipse
I'm trying to run a simple servlet and can't to do it
I've tryed to put class file of this servlet into webapps/ROOT/
and run it _http://localhost:8080/servlet/Hello
in both cases 404 error appers
In the same time jsp pages without servlets work fine
What's a problem


Thanks
[ September 01, 2003: Message edited by: Kaspar Minosiants ]
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
how abt an entry in web.xml
the web.xml must be in webapps\ROOT\WEB-INF
and what about the url that you are giving:
http://localhost:8080/tr/servlet/Hello
What exactly does "tr" specify..??..is your servlet mapped to this particular URL..??
hth
MB


Malhar Barai
SOA & Java Book
Kaspar Minosiants
Greenhorn

Joined: Jun 21, 2003
Posts: 13
I've just edit post
This was link to run servlet which is in exlipse project
tr dir have bin added into server.xml file of Tomcat
_http://localhost:8080/tr/servlet/Hello
After i saw that it didn't work i moved Hello.class file into webapps\ROOT\WEB-INF\classes
and used _http://localhost:8080/servlet/Hello to run it
it doesn't work in both cases .
It's not normal behaviour. Is it ?

how abt an entry in web.xml
the web.xml must be in webapps\ROOT\WEB-INF

there is this file in this dir
there is it's content. I've not edited it

Thanks for reply
[ September 01, 2003: Message edited by: Kaspar Minosiants ]
[ September 01, 2003: Message edited by: Kaspar Minosiants ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
webapps\ROOT\ is for the ROOT so-called-default application. but u should have webapps\tr\WEB-INF\classes...
i hope u got the point! create the "tr" directory...
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12791
    
    5
As I think I already answered elsewhere, it looks like you have been bit by the "invoker" servlet. The URL usage .../servlet/Hello requires that the invoker servlet be turned on. See the ../conf/web.xml file, search for "invoker"
This has GOT to be the most common problem we see here. Due to the fact that before Tomcat 4 the invoker was on by default and most of the servlet books used the ../servlet/ style because it didn't involve explaining web.xml entries for servlets.
Bill
Kaspar Minosiants
Greenhorn

Joined: Jun 21, 2003
Posts: 13
Thanks A Lot !
William Brogden

....requires that the invoker servlet be turned on

It was the reason of my trouble
 
GeeCON Prague 2014
 
subject: problem while running servlet