The Artima Developer Community
Sponsored Link

Web Services Forum
running a servlet with tomcat

4 replies on 1 page. Most recent reply: Feb 7, 2003 3:09 PM by Steve Downie

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
|arod

Posts: 3
Nickname: predicator
Registered: Jan, 2003

running a servlet with tomcat Posted: Jan 24, 2003 3:08 AM
Reply to this message Reply
Advertisement
hi !

i have a problem with tomcat 4.1.18, and nobody can answer me...
here ALL i did...

i have downloaded tomcat-4.1.18.exe
i installed it (not as a service) in c:\serveur\tomcat4.1 (no space in the name)
i have set

%TOMCAT_HOME%=c:\serveur\tomcat4.1
%CATALINA_HOME%=c:\serveur\tomcat4.1

t hen i created the tree
%TOMCAT_HOME%\webapps\hello\WEB-INF\classes

i have put Hello.class (a helloworld like class, nothing to care about) in the classes dir
and the web.xml (from the ROOT\WEB-INF dir) in the WEB-INF dir




<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
</web-app>




i add in server.xml, just above the "examples" context,




<Context path="/hello" docBase="hello" debug="9" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_hello_log." suffix=".txt" timestamp="true" />
</Context>




i launch tomcat
no error message
i try
http://localhost:8080/examples/servlet/HelloWorld
---> it works
http://localhost:8080/hello/servlet/Hello
--->



Etat HTTP 404 - /hello/servlet/Hello

--------------------------------------------------------- -----------------------

type Rapport d''?tat

message /hello/servlet/Hello

description La ressource demand?e (/hello/servlet/Hello) n'est pas disponible.




when i have a look at webapps runing with http://localhost:8080/admin/list, i have




OK - Applications list?es pour l'h?te virtuel (virtual host) localhost
/admin:running:0:../server/webapps/admin
/webdav:running:0:C:\Serveur \Tomcat4.1\webapps\webdav
/examples:running:0:examples
/tomcat-docs:running:0:C: \Serveur\Tomcat4.1\webapps\tomcat-docs
/hello:running:0:hello
/:running:1:C:\Ser veur\Tomcat4.1\webapps\ROOT
/manager:running:0:../server/webapps/manager




so , where is the problem ?
please elp, i really don't know what to do :(


Amit Kuiya

Posts: 1
Nickname: amit999
Registered: Jan, 2003

Re: running a servlet with tomcat Posted: Jan 24, 2003 9:59 PM
Reply to this message Reply
Hy
This is amit kuiya from india,well dear do one thing
as Default root specified in tomcat setting file is ROOT
so u have 2 options:

1. Keep ur servlet in /Webapps/Root/WEB_INF/classes/Hello
and run it as http://nameserver:8080/servlet/Hello

2. In ur server.xml file find the word ROOT and just replace that with Ur desired Directory
and then
Keep ur servlet in /Webapps/Directory/WEB_INF/classes/Hello
and run it as http://nameserver:8080/servlet/Hello


Both will work fine

mail me if still finding diff
at amitkuiya@rediffmail.com
Bye

|arod

Posts: 3
Nickname: predicator
Registered: Jan, 2003

Re: running a servlet with tomcat Posted: Jan 28, 2003 6:30 AM
Reply to this message Reply
thx for your help...
i found the problem !
it's due to the fact that the servlet invoker is disabled since tomcat 4.1.12...
i onlye had to enabled it in the conf/web.xlm :)

now i have to find how deny access to the repertories i don't want to be seen... *sigh*

|arod

Posts: 3
Nickname: predicator
Registered: Jan, 2003

Re: running a servlet with tomcat Posted: Feb 3, 2003 1:34 AM
Reply to this message Reply
does someone know when the servlet instances are destroyed ?
i have a problem with servlet that don't kill connexions when they aren't uses anymore...

does tomcat destroy the servlet when the session times out ? can i put the disconnection in the detructor ?

thx for replies

Steve Downie

Posts: 1
Nickname: sdownie
Registered: Feb, 2003

Re: running a servlet with tomcat Posted: Feb 7, 2003 3:09 PM
Reply to this message Reply
Jarod,

I've encountered the same problem.

How did you solve it?

Did you change server.xml and if so, could you post an example?

Thanks,

-- Steve Downie

Flat View: This topic has 4 replies on 1 page
Topic: Tomcat4.1.18/Apache 2.0.44 Previous Topic   Next Topic Topic: MySQL database hosting

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use