> -----Original Message-----
> From: Jim Henderson [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, December 11, 2002 3:29 PM
> To: 'Tomcat Users List'
> Subject: RE: Directory Structure
> 
> 
> For 3+ days I have been trying to get a servlet to run in 
> Tomcat 4.1.12.  It ran fine in 4.0.  It is the only servlet 
> in webapp package of 6 JSP pages. The JSP pages work OK, they 
> even use the JSTL. The application is displayed in a series 
> of HTML frames, with the servlet being the last item to be displayed.
> 
> If I comment out most of the code in my servlet and comment 
> out the "package xxx" at the top of the file, it works (no 
> function but is displayed) and it is pulled out of the java 
> .jar file.  I have tried almost every combination of 
> <servlet-mapping> in the web.xml file that I can think of.  
> When I include the "package mfnettags" at the top of the java 
> source file I have made subdirectories and copies of it all 
> over the place in the WAR file
>       mfnettags\servlet\classes
>       mfnettags\servlet\classes\mfnettags
>       mfnettags\WEB-INF\classes\mfnettags
>       mfnettags\WEB-INF\classes
>       mfnettags\WEB-INF\mfnettags
>       mfnettags\WEB-INF\mfnettags\classes
>       etc ...
> in hopes that it would find it.
> 
> I have tried to follow every posted suggestion on how to process:
> 
>       javax.servlet.ServletException: Cannot allocate servlet 
> instance for path /mfnettags/servlet/DocViewServlet and
>       java.lang.NoClassDefFoundError: DocViewServlet (wrong name:
> mfnettags/DocViewServlet)
> or
>       Requested resource ... not available.
> 
> The Java servlet name is: DocViewServlet
> The Java servlet package is: mfnettags
> The web application is: mfnettags
> 
> This is driving me bananas.
> 
> Any suggestions?


What are you using for your servlet element and servlet-mapping element?

The class, if you have "package mfnettags" should be at
mfnettags/WEB-INF/classes/mfnettags/DocViewServlet.class

The servlet declaration should be like this:

<servlet>
  <servlet-name>DocViewServlet</servlet-name>
  <servlet-class>mfnettags.DocViewServlet</servlet-class>
</servlet

The mapping should be something like this:

<servlet-mapping>
  <servlet-name>DocViewServlet</servlet-name>
  <url-pattern>/servlet/DocViewServlet</url-pattern> <!-- or whatever
you like -->
</servlet mapping>

It sounds to me like you may have forgotten the package name in the
servlet-class element above.

-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to