tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Samuel" <jos...@atinav.com>
Subject RE: Servlet class not found
Date Wed, 24 Nov 2004 11:35:23 GMT

It seems that the package is not properly declared in it. Check it.


-----Original Message-----
From: Richard Lewis [mailto:richardlewis@fastmail.co.uk]
Sent: Wednesday, November 24, 2004 4:51 PM
To: tomcat-user@jakarta.apache.org
Subject: Servlet class not found


Hello,

This is probably quite a simple question but I couldn't find an answer
in the archives:

I'm writing a servlet to perform a little search on my website. The
servlet is compiled and is in a directory structure like this:

$CATALINA_HOME/webapps/StudioSearch
   +-- index.html   (provides a form to do a test search)
   +-- WEB-INF/
        +-- web.xml   (see below)
        +-- classes/
             +-- uk/
                  +-- ac/
                       +-- uea/
                            +-- studios/
                                 +-- StudioSearch.class
                                 +-- StudioSearch.java

web.xml looks like this:
<web-app>
    <servlet>
        <servlet-name>StudioSearch</servlet-name>
        <servlet-class>uk.ac.uea.studios.StudioSearch</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>StudioSearch</servlet-name>
        <url-pattern>/studio-search</url-pattern>
    </servlet-mapping>
</web-app>

When I visit: http://localhost:8080/StudioSearch/ I get the index page
as expected. This page has a <form> element where the action is
"studio-search" but when I submit this form I get the following error:

javax.servlet.ServletException: Error allocating a servlet instance
......
java.lang.NoClassDefFoundError: uk/ac/uea/studios/StudioSearch (wrong
name: StudioSearch)
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:539)

I've checked all the spelling and case and that I'm not using '.class'
(the StudioSearch.java file isn't confusing it, is it?) but I can't seem
to make it work. (I know the servlet class itself works because I've
executed it Tomcat's ROOT webapp.)

Any ideas?

Thanks,
Richard
-- 
  Richard Lewis
  richardlewis@fastmail.co.uk


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

---------------------------------------------------------------------
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