• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Servlets program error

 
Angus Nalder
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34965
377
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Angus,
Thanks for posting the solution. And welcome to JavaRanch!
 
surbhi tugnawat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic