tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: Servlet class not found
Date Wed, 24 Nov 2004 11:29:51 GMT
can we see the form action value? it should be action="/studio-search"

Allistair 

> -----Original Message-----
> From: Richard Lewis [mailto:richardlewis@fastmail.co.uk]
> Sent: 24 November 2004 11:21
> 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
> 
> 


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


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