• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Does anyone get the following error

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have studied the HFSJ and worked on the example of BeerSelect servlet. I have followed the example and deploy my servlet accordingly. However, I always get

---------------------------------------
description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Wrapper cannot find servlet class com.example.web.BeerSelect or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)

root cause
java.lang.ClassNotFoundException: com.example.web.BeerSelect
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
-------------------------------------------------------------

I have already checked that
I have my servlet inside directory C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\com\example\web

Does anyone know why it cannot run? Many thanks for your help.

Kenneth
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have my servlet inside directory C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\com\example\web



Don't you have classes folder in

Beer-v1\WEB-INF\classes\com\example\web


like this in your path? May be that's the problem.
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As stated JVM is not able to find the class com.example.web.BeerSelect,
see where does the compiled class file go to?

Generally class files are placed under "classes" directory under WEB-INF,
where container looks for them.
 
kenneth See
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, my friend.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic