This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
description The server encountered an internal error () that prevented it from fulfilling this request.
javax.servlet.ServletException: Wrapper cannot find servlet class Retreive or a class it depends on org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644) java.lang.Thread.run(Thread.java:595)
previously i executed the same program properly and retrived the data from the table correctly when i inserted the new rows in the table and run the above program its throwing that exeption I added related jar file correctly,i set the classpath correctly but why my program is not working i am unable to find where i did the mistake if any body find plese tell me where did i dont mistake
tahQ geeta [ April 02, 2008: Message edited by: David O'Meara ]
Originally posted by suri jagadish: ... But i was only trying to establish a fact.
There are some cases where unpackaged classes will not be found in a servlet application and some cases where they will. If anyone's interested in the specific reasons for this, see: http://faq.javaranch.com/search?PackageYourBeans It contains links to the relavent bug reports on Sun's site.
Rather than get into the nuances of when you can get away with using the default package and when you can't--a confusing thing to have to learn just to get away with ignoring a good practice--we (knowing full well what the facts are) stress that all classes in a Java web application should be packaged, period.
From, an academic standpoint, it might be interesting to learn all the ins and outs of this, and for an intermediate, who has to maintain a large legacy application it might actually be useful to understand when an unpackaged class will or will not be found when debugging a ClassNotFoundException. For someone starting out learning servlets, however, there is never a good case for using the default package in a web application and the smartest thing to do (especially when trying to figure out why one of these early examples isn't working) is to rule out any of these subtle bugs by packaging everything, always. To teach someone otherwise is to do them a disservice. [ April 03, 2008: Message edited by: Ben Souther ]