• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Head First Servlets program error

 
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
 
author & internet detective
Posts: 39435
768
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Angus,
Thanks for posting the solution. And welcome to JavaRanch!
 
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
 
This tiny ad is wafer thin:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!