关于servlet的另一个问题

时间:2011-08-10 08:12:39

标签: java tomcat servlets jasper-reports tomcat5.5

正如我已经向the similar question提出有关servlet的问题,这是用于显示浏览器的报告。在创建之后,我使用Eclipse重建了一个Danymic Web项目(名为JasperServlet)。编译和maping servlet(名为FirstReportSendToBrowserServlet),将servlet放入Apache Tomcat v5.5,在我启动tomcat后,打开http://localhost:8080/JasperServlet/FR(FirstReportSendToBrowserServlet已映射到web.xml中的FR),我得到了什么困惑的我:

  

例外

     

javax.servlet.ServletException:实例化servlet类时出错   FirstReportSendToBrowserServlet     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)     org.apache.coyote.http11.Http11BaseProtocol $ Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)     org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)     org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)     org.apache.tomcat.util.threads.ThreadPool $ ControlRunnable.run(ThreadPool.java:684)     java.lang.Thread.run(Thread.java:619)根本原因

     

java.lang.NoClassDefFoundError:   净/平方英尺/ JasperReports的/发动机/ JRException     java.lang.Class.getDeclaredConstructors0(本机方法)     java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)     java.lang.Class.getConstructor0(Class.java:2699)     java.lang.Class.newInstance0(Class.java:326)     java.lang.Class.newInstance(Class.java:308)     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)     org.apache.coyote.http11.Http11BaseProtocol $ Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)     org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)     org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)     org.apache.tomcat.util.threads.ThreadPool $ ControlRunnable.run(ThreadPool.java:684)     java.lang.Thread.run(Thread.java:619)

我已经在Apache's bugzilla中找到了,但似乎我找不到类似的答案。有人能给出提示吗?

1 个答案:

答案 0 :(得分:3)

jasper-reports.jar中需要WEB-INF/lib。 NoClassDefFoundError意味着应用程序需要一个类在类路径上,但它缺少。 Web应用程序的类路径由以下形式构成:

  • WEB-INF /类
  • WEB-INF / lib中
  • 容器库