tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hole <steve.h...@messagingdirect.com>
Subject Manual servlet deployment problems on 4.1.18
Date Wed, 26 Feb 2003 18:03:54 GMT
Yes, I am a newbie.

I am having some difficulty in getting *any* servlets to deploy on a 
Tomcat 4.1.3 installation in my development environment.   It is very 
likely a simple configuration problem, but I have tried about everything I
can think of to resolve it with no luck.

Environment:

 j2sdk1.4.1_01
 jakarta-tomcat-4.1.18
 Redhat Linux 8.0 (kernel 2.4.18)

All of the example, management and admin servlets are working properly in 
the Tomcat instance.

I have tried the simplest possible servlet implementation "simple" (hello 
world). The class definition was ripped of directly from the shipped 
examples with only a name change in the class itself (to hopefully 
eliminate java class loading problems).

The servlet was deployed as:

  {CATALINA_HOME}/webapps/simple
  {CATALINA_HOME}/webapps/simple/WEB-INF/web.xml
  {CATALINA_HOME}/webapps/simple/WEB-INF/classes/simple.class

The web.xml file contains (less the ---- delimiters):
----
<?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/j2ee/dtds/web-app_2_3.dtd">

<web-app>
  <servlet>
    <servlet-name>simple</servlet-name>
    <servlet-class>ca.esys.simple</servlet-class>
  </servlet>

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

</web-app>
----

The behaviour that I see is:

1.   The servlet appears to deploy when Tomcat starts up (at least the 
logs seem to say so).   It appears to find the class libraries.

2.   When I run the servlet it simply lists the 
${CATALINA_HOME}/webapps/simple directory.   The logs seem to indicate 
that it maps the URI to the "default" servlet, which lists directories.  
It does not run the servlet class that I specify in the web.xml file.


I have tried the following things:

1.   I created the following <context> element in the server.xml file to 
explicitly define the context (rather than letting it build an implicit 
context).

<Context path="/simple" docBase="simple" debug="1" reloadable="true" />

Note that I turned on debugging which elicited the following log entries 
in the logs/localhost_log.2003-02-26.txt file.

2003-02-26 10:25:02 StandardContext[/simple]: Mapping contextPath='/simple' with requestURI='/simple/'
and relativeURI='/'
2003-02-26 10:25:02 StandardContext[/simple]:  Mapped to servlet 'default' with servlet path
'/' and path info 'null' and update=true

Which seems to confirm the mapping of the URI to the default servlet 
rather than the "simple" servlet.

2.   The original "simple" class was not part of a package and I had it
placed directly under the "classes" directory.  I tried defining it to be 
in the ca.esys package and put it under the classes/ca/esys directory, but
that didn't work.

3.   I've tried referring to the servlet using the URI's:

 localhost:8080/simple
 localhost:8080/servlet/simple

The first maps to the default servlet.   The second gives a "resource 
unavailable" error - which I would expect.

So ...

I am at a loss.   Any ideas for things to try would be very helpful.  I've
looked at every example I could find and scanned through the list archive 
for similar things, but had no luck. 

Thanks ahead for any help that you can provide.

Cheers.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message