birt报表报错, There is no report design object available.org.eclipse.birt.report.exception.ViewerExcepti

报错信息如下:

- There is no report design object available.
org.eclipse.birt.report.exception.ViewerException: There is no report design object available.

	at org.eclipse.birt.report.context.ViewerAttributeBean.__init(ViewerAttributeBean.java:226)

	at org.eclipse.birt.report.context.BaseAttributeBean.init(BaseAttributeBean.java:233)

	at org.eclipse.birt.report.context.ViewerAttributeBean.<init>(ViewerAttributeBean.java:118)

	at org.eclipse.birt.report.context.BirtContext.__init(BirtContext.java:44)

	at org.eclipse.birt.report.context.BaseContext.<init>(BaseContext.java:69)

	at org.eclipse.birt.report.context.BirtContext.<init>(BirtContext.java:30)

	at org.eclipse.birt.report.servlet.ViewerServlet.__getContext(ViewerServlet.java:150)

	at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.java:151)

	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

	at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

	at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)

	at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

	at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:177)

	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)

	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

	at java.lang.Thread.run(Unknown Source)

出现了这个错误顿时晕了,由于刚接触birt报表,不知道从那里入手,后经过百度和请教人,总结了如下的解决方法:

由于公司创建birt报表的版本较低为2.6.2,我现在用的是4.4.2版本,由于版本不一致引起的错误。注意报表文件的开头:

<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
    <property name="comments">版权所有 (c) 2006 <<此处是您公司的名称>></property>
    <property name="createdBy">Eclipse BIRT Designer Version 4.4.2.v201410272105 Build <4.4.2.v20150217-1805></property>
report节点的属性version的值为:3.2.23,此时我用的birt的版本为4.4.2(version对应为3.2.23),而公司用的是2.6.2(version对应为3.2.22),只需要将version的值修改为低版本就行(3.2.22)就行,不过建议修改下name="createBy"的property节点的文本值(这个修不修改都不会报错的),改为以前的文本值(修改birt报表文件之前建议将这个值先保存下来),避免发生混淆。修改后如下:

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22" id="1">
    <property name="comments">版权所有 (c) 2006 <<此处是您公司的名称>></property>
    <property name="createdBy">Eclipse BIRT Designer Version 2.6.2.r262_v20110209 Build <2.6.2.v20110214-1523></property>
这些修改应该根据你自己的实际情况进行修改,上面只是以我自己的为例。



郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。