wood burning stoves 2.0*
The moose likes Servlets and the fly likes Head First Servlets program error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Head First Servlets program error" Watch "Head First Servlets program error" New topic
Author

Head First Servlets program error

Angus Nalder
Greenhorn

Joined: Feb 27, 2005
Posts: 2
When trying to test the servlet from page 81 of Head First Servlets, I get the following error from Tomcat:
javax.servlet.ServletException: wrapper cannot find servlet class com.example.web.BeerSelect or a class it depends on.

The web.xml file has
..
<servlet>
<servlet-name>Ch3 Beer</servlet>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet>

The form.html page has "SelectBeer.do" as the action.
I managed to compile ok after reading a previous thread, and the .class file is in classes/com/example/web/BeerSelect.class but am stuck as to what to try next to get it to work.
Thanks for any suggestions
Angus Nalder
Greenhorn

Joined: Feb 27, 2005
Posts: 2
As soon as i posted the message, i went back to look at it and saw my problem.
I had copy and pasted from my development environment into tomcat/webapps and didn't have the classes folder inside WEB-INF.

Thanks for reading though
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31054
    
232

Angus,
Thanks for posting the solution. And welcome to JavaRanch!


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
surbhi tugnawat
Greenhorn

Joined: Mar 11, 2005
Posts: 5
Hi!
I am new to servlets and I am trying to run one of the examples from HSFJ(page 81). I am getting "Wrapper cannot find servlet class " ....cant figure out why...

please help!
Surbhi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Head First Servlets program error