You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ador Tuazon <ad...@invera.com> on 2000/09/01 21:42:40 UTC

RE: Apache and Tomcat running, cant hit servlets in new directory ...

	This mail is intended to the person who is aliasing my name.  Why
don't you use your official address name instead is stealing someone else.  

-----Original Message-----
From: adort@invera.com [mailto:adort@invera.com]
Sent: Friday, September 01, 2000 3:07 PM
To: tomcat-user@jakarta.apache.org
Subject: Apache and Tomcat running, cant hit servlets in new
directory...



I have Apache and Tomcat up and running.
I wish to create servlets and jsp pages in a place other then
/webapps/examples
The place I wish to do this is

C:\mec_dev

I have created a directory structure with the following.

c:\mec_dev\Web-Inf\web.xml
c:\mec_dev\Web-Inf\classes\HelloWorldExample.java (.class)


I have followed the instructions and done the following things.

- 1 -
Edited http.conf as follows

include "c:/tomcat/conf/my-tomcat-apache.conf"


- 2 -

Edited my-tomcat-apache.conf as follows

Alias /mec_dev C:\mec_dev
<Directory "C:\mec_dev">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /mec_dev/servlet /mec_dev
<Location /mec_dev/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

- 3 -

Edited server.xml as follows

<Context path="/mec_dev" docBase="C:\mec_dev" debug="9" reloadable="true">
</Context>

- 4 -

Created a web.xml file in C:\mec_dev\Web-Inf

like this

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

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
    <servlet>
        <servlet-name>
            HelloWorldExample
        </servlet-name>
        <servlet-class>
            HelloWorldExample
        </servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>
            HelloWorldExample
        </servlet-name>
        <url-pattern>
            /HelloWorldExample
        </url-pattern>
    </servlet-mapping>

</web-app>


When I use the browser to hit
http://localhost:8080/examples/servlet/HelloWorldExample

The example pops up no problem, however when I hit

http://localhost:8080/mec_dev/servlet/HelloWorldExample

404 error, and the tomcat.log says....

Context log: path="/mec_dev" Can't find servet HelloWorldExample
Context log: path="/mec_dev" In error handler 404 null / R( /mec_dev +
/servlet/HelloWorldExample + null)
Context log: path="/mec_dev" Error: Calling servlet Wrapper(tomcat.errorPage
S:org.apache.tomcat.servlets.DefaultErrorPage)