在jsp中使用ireport报表,报出如下错误,请大牛帮忙解答
在jsp中引入ireport报表,出现如下错误:
org.apache.jasper.JasperException:
java.lang.ClassCastException:
net.sf.jasperreports.engine.JasperReport cannot be cast to dori.jasper.engine.JasperReport
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(JspServletWrapper.java:502)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
调试两天了,把所有的与ireport有关的jar包都引进了。还是不行。不知道怎么办了,请各位大牛指点一二。谢谢!
------解决方案--------------------net.sf.jasperreports.engine.JasperReport cannot be cast to dori.jasper.engine.JasperReport
应该是你的引入出问题了,你将
net.sf.jasperreports.engine.JasperReport的类强制转换成ori.jasper.engine.JasperReport的类、
------解决方案--------------------
你看你的代码中哪里应用了JasperReport,你在引包的时候引成了ori.jasper.engine.JasperReport。应该改成net.sf.jasperreports.engine.JasperReport
------解决方案--------------------yes,应该就如上两位所说