遇到一个JasperReports的问题,求帮忙解决

adicool 2006-02-13 11:55:50
我在用ireport+JasperReports开发的时候,遇到一个这样的问题:
java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/compiler/env/INameEnvironment
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
at java.lang.Class.getConstructor0(Class.java:1930)
at java.lang.Class.newInstance0(Class.java:278)
at java.lang.Class.newInstance(Class.java:261)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.getCompiler(JRDefaultCompiler.java:178)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.loadEvaluator(JRDefaultCompiler.java:193)
at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:382)
at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:451)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:91)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:73)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:113)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:57)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:163)
at net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:124)
at org.apache.jsp.jsp.pdf_jsp._jspService(pdf_jsp.java:79)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)

程序代码如下:
<%@ page errorPage="error.jsp" %>

<%@ page import="net.sf.jasperreports.engine.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>

<%
File reportFile = new File(application.getRealPath("/reports/bfjhdb.jasper"));
if (!reportFile.exists())
throw new JRRuntimeException("File WebappReport.jasper not found. The report design must be compiled first.");

Connection con=null;
String url="jdbc:oracle:thin:@192.168.120.110:1521:tea";
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection(url,"hnqs","hnqs");
}
catch(Exception e)
{
System.out.println("数据库操作出错");
}

Map parameters = new HashMap();
/*
parameters.put("ReportTitle", "Address Report");
parameters.put("BaseDir", reportFile.getParentFile());
*/
parameters.put("SQLSTR","select * from bfj_ck_hdb where checktype=1");

byte[] bytes =
JasperRunManager.runReportToPdf(
reportFile.getPath(),
parameters,
con
);

response.setContentType("application/pdf");
response.setContentLength(bytes.length);
ServletOutputStream ouputStream = response.getOutputStream();
ouputStream.write(bytes, 0, bytes.length);
ouputStream.flush();
ouputStream.close();
%>

报表文件可以预缆,哪为大人可以帮助我一下。
...全文
71 点赞 收藏 回复
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2006-02-13 11:55
社区公告
暂无公告