tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Freyr Stefansson <ste...@decode.is>
Subject RE: Unable to add/run servlet in new webapp
Date Thu, 27 Apr 2000 19:37:52 GMT
Hi.

I believe your web.xml should be in webapps\select\WEB-INF folder but not
the classes folder.
As was pointed out by Larry Isaacs your class file should be in the
webapps\select\WEB-INF\classes\javax\servlet\http\HttpServlet folder (you
need to create the package structure within the classes folder, so if you
have a class you would normally refer to as mypackage.subpackage.Myclass you
should have the following directory structure in your classes folder
(folders/directories have a backslash preceding the name and "..." means
there's more there... I just don't feel like writing it all ;o)):

\webapp_name
     |
     +-\WEB-INF
     |    |
     |    +-\classes
     |    |    |
     |    |    +-\mypackage
     |    |         |
     |    |         +-\subpackage
     |    |               |
     |    |               +-Myclass.class
     |    |
     |    +-\lib
     +-...


-----Original Message-----
From: John.Robinson@knowledgehouse.net
[mailto:John.Robinson@knowledgehouse.net]
Sent: 27. april 2000 19:05
To: tomcat-user@jakarta.apache.org
Subject: Unable to add/run servlet in new webapp



Hi all,

I'm having difficulty setting up a new servlet in tomcat.  I've reduced the
variables by taking apache out of the equation, but no change resulted.

I have tomcat setup and started and serving web pages.  I've setup my
context in server.xml, and in my webapp directory.  It is named select.
I've got a web.xml file.

My web.xml file (located in webapps\select\WEB-INF\classes)  has the
following entry:

    <servlet>
        <servlet-name>
            hello
        </servlet-name>
        <servlet-class>
           javax.servlet.http.HttpServlet.HelloWorldExample
        </servlet-class>

        <url-pattern>
            /hello
        </url-pattern>

     </servlet>

The HelloWorldExample.class file is in the following locations:
webapps\select, webapps\select\WEB-INF, and webapps\select\WEB-INF\classes.

I have not made a .war file.  Do I have to?

My tomcat.conf file has the following lines in it:

Alias /select D:\tomcat\jakarta-tomcat\webapps\select
<Directory "D:\tomcat\jakarta-tomcat\webapps\select">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /select/servlet /select
<Location /select/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

The URL I'm using to hit the servlet is:
http://localhost:8080/select/servlet/HelloWorldExample


I have tried this with and without apache running.  I've made numerous
modifications to the tomcat.conf file (and verified that this is the one
being included by apache) all to no avail.

I'm sure I must be missing something really stupid but for the life of me I
can't figure out what it is.  Any suggestions?



John Robinson
Technical Architect
Knowledge House Inc.
5670 Spring Garden Road
Suite 200
Halifax, Nova Scotia
Canada B3J 1H6
902.429.1375 Tel
902.429.2858 Fax
902.490.2936 Direct
www.knowledgehouse.net




--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message