Strip your web.xml file down to this:

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

<web-app xmlns="http://java.sun.com/xml/ns/javaee";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
   version="2.5">

    <description>
      Servlet and JSP Examples. Hello World Test
    </description>
    <display-name>HelloWorld Test</display-name>

    <servlet>
        <servlet-name>Test</servlet-name>
        <servlet-class>Test</servlet-class>
    </servlet>

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

</web-app>

And it should work if you access http://localhost:8080/Test/Test --
obviously replacing localhost:8080 with whatever you normally use to get
to your tomcat service.  You don't have all those filters, listeners and
other servlets in your webapp, so don't include them.  Later on when you
get some footing in building servlets, you should make sure all your
classes are in packages as well.

--David

John Byrne wrote:
> David, and everyone else,
>
> Here is the file layout:
> C:\tomcat\apache-tomcat-6.0.18\webapps\Test\WEB-INF\web.xml
> C:\tomcat\apache-tomcat-6.0.18\webapps\Test\WEB-INF\lib
> C:\tomcat\apache-tomcat-6.0.18\webapps\Test\WEB-INF\classes\Test.class
>
> (I've also attached a zip file with the Test Directory in it.  The root
> to this directory is the same as above)
>
> Attached is my web.xml file.  (It is the same xml file that comes with
> the distribution except the added code below.)
>
> The only thing I added was:
> <!-- added Test code -->
>
>     <servlet>
>         <servlet-name>Test</servlet-name>
>         <servlet-class>Test</servlet-class>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>Test</servlet-name>
>         <url-pattern>/Test</url-pattern>
>     </servlet-mapping>
> )
>
>
> John Byrne
> Support Network for Battered Women
> 1257 Tasman Dr. Suite C
> Sunnyvale, CA
> 94089
>  
> (408) 541-6100 x 138
> Fax: (408) 541-3333
>
> -----Original Message-----
> From: David Smith [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 30, 2008 3:53 PM
> To: Tomcat Users List
> Subject: Re: Version 6.0.18 of Tomcat
>
>   
>> However, I get an error in
>> the users log specifying a class is not found. Is this my Test.class
>> file it can't find?  
>>     
> Nope.  The class not found is listeners.SessionListener.  Can you post
> Test/WEB-INF/web.xml?  Also can you post some info regarding your file
> layout?
>
>   
>> The container itself doesn't "start" either.  In the Tomcat output
>> window it says:
>>     
> The container started fine.  Your web application didn't start because
> of the error not finding listeners.SessionListener..
>
> --David
>
> John Byrne wrote:
>   
>> I've tried for 2 days now to get my own HelloWorld program working
>>     
> with
>   
>> Apache Tomcat.  I have the exact same structure that the examples and
>> ROOT containers in the distribution have.  However, I get an error in
>> the users log specifying a class is not found. Is this my Test.class
>> file it can't find?  
>>
>>  
>>
>> Oct 30, 2008 2:25:21 PM org.apache.catalina.core.StandardContext
>> listenerStart
>>
>> SEVERE: Error configuring application listener of class
>> listeners.SessionListener
>>
>> java.lang.ClassNotFoundException: listeners.SessionListener
>>
>>             at
>>
>>     
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>   
>> .java:1387)
>>
>>             at
>>
>>     
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>   
>> .java:1233)
>>
>>             at
>>
>>     
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.j
>   
>> ava:3786)
>>
>>             at
>>
>>     
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4342
>   
>> )
>>
>>             at
>>
>>     
> org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:124
>   
>> 7)
>>
>>             at
>>
>>     
> org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.
>   
>> java:604)
>>
>>             at
>>
>>     
> org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.
>   
>> java:129)
>>
>>             at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>>
>>             at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>
>>             at
>>
>>     
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>   
>> tionFilterChain.java:290)
>>
>>             at
>>
>>     
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>   
>> erChain.java:206)
>>
>>             at
>>
>>     
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
>   
>> e.java:233)
>>
>>             at
>>
>>     
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
>   
>> e.java:191)
>>
>>             at
>>
>>     
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
>   
>> Base.java:525)
>>
>>             at
>>
>>     
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>   
>> :128)
>>
>>             at
>>
>>     
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
>   
>> :102)
>>
>>             at
>>
>>     
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
>   
>> java:109)
>>
>>             at
>>
>>     
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
>   
>> 86)
>>
>>             at
>>
>>     
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84
>   
>> 5)
>>
>>             at
>>
>>     
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
>   
>> Http11Protocol.java:583)
>>
>>             at
>>
>>     
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>   
>>             at java.lang.Thread.run(Unknown Source)
>>
>>  
>>
>>  
>>
>> The container itself doesn't "start" either.  In the Tomcat output
>> window it says:
>>
>> Oct 30, 2008 3:07:50 PM org.apache.catalina.core.StandardContext start
>>
>> SEVERE: Error listenerStart
>>
>> Oct 30, 2008 3:07:50 PM org.apache.catalina.core.StandardContext start
>>
>> SEVERE: Context [/Test] startup failed due to previous errors
>>
>>  
>>
>> When I click on the /Test container in the manager it replies:
>>
>> type Status report
>>
>> message 
>>
>> description The requested resource () is not available.
>>
>> I even tried putting the libraries in the examples directory in my own
>> Test lib directory.
>>
>>  
>>
>> I've run out of things to try.  Is there something else I can test the
>> system with?
>>
>>  
>>
>> Any help would be greatly appreciated.  
>>
>>  
>>
>>  
>>
>> John Byrne
>>
>> Support Network for Battered Women
>>
>> 1257 Tasman Dr. Suite C
>>
>> Sunnyvale, CA
>>
>> 94089
>>
>>  
>>
>> (408) 541-6100 x 138
>>
>> Fax: (408) 541-3333
>>
>>  
>>
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>   
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to