tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Welch <martin.we...@CODA.com>
Subject Servlets In A Package
Date Wed, 25 Jul 2001 08:36:28 GMT
Hi,

I've recently installed JBoss-2.4.0_Tomcat-3.2.2 and I'm now starting to
experiment with all the JBoss samples. The first, Interest, contains a
servlet that I'm trying to get up and running.

This InterestServlet is in a package org.jboss.docs.interest which I've
compiled and placed in 

webapps\demo\WEB-INF\classes\org\jboss\docs\interest

demo\WEB-INF\web.xml looks like:

------------------------------------------
<?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>
            interest
        </servlet-name>
        <servlet-class>
            org.jboss.docs.interest.InterestServlet
        </servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>
            interest
        </servlet-name>
        <url-pattern>
            /catalog
        </url-pattern>
    </servlet-mapping>
</web-app>
------------------------------------------

and I've added the following to conf\server.xml

------------------------------------------
        <Context path="/demo" 
                 docBase="webapps/demo" 
                 crossContext="false"
                 debug="0" 
                 reloadable="true" > 
        </Context>
------------------------------------------

When I enter http://localhost:8080/demo/catalog in my browser I get:

------------------------------------------
Location: /demo/catalog
Internal Servlet Error:

java.lang.NoClassDefFoundError: org/jboss/docs/interest/Interest
	at java.lang.Class.newInstance0(Native Method)
	at java.lang.Class.newInstance(Unknown Source)
	at
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:268)
	at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
	at org.apache.tomcat.core.Handler.service(Handler.java:254)
	at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
	at java.lang.Thread.run(Unknown Source)
------------------------------------------

I've looked at other TomCat samples, in particular
webapps\test\WEB-INF\classes\requestMap and I appear
to have done everything right but I can't make sense of this.

Could someone help me?

Thanks,

Martin

Mime
View raw message