eclipse 将birt从4.4版迁移到4.9版,资源路径[ /.../...]已规范化为无效的空值

flmtquvp  于 2022-11-04  发布在  Eclipse
关注(0)|答案(2)|浏览(152)

错误迁移birt 4.4到4.9我有一个问题,当运行一个报告,当打开布局时,它是一个
“资源路径[ /.../...]已标准化为无效的null”
你知道这可能是什么吗?
我把错误发生的部分源代码和错误本身。
来源:

InputStream fileLayout = new 
    ByteArrayInputStream(EntityUtils.toByteArray(methodLayoutReport.getEntity()));

    String reportEnder = servlet.getRealPath("Report/include/glw/view/report") + "/" + reportName
    + ".rptdesign";

    design = birtReportEngine.openReportDesign(reportEnder, fileLayout);//line error

错误:

INFO: Server startup in [23135] milliseconds
java.lang.IllegalArgumentException: The resource path [/WEB-INF/classes/…/…/…/…/estrutura/est_report_library_base.rptlibrary] has been normalized to [null] which is not valid
at org.apache.catalina.webresources.StandardRoot.validate(StandardRoot.java:266)
at org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:212)
at org.apache.catalina.webresources.StandardRoot.getClassLoaderResource(StandardRoot.java:225)
at org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:954)
at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1078)
at org.eclipse.birt.report.model.util.ResourceLocatorImplBase.tryFragmentSearch(ResourceLocatorImplBase.java:289)
at org.eclipse.birt.report.model.util.ResourceLocatorImplBase.getResource(ResourceLocatorImplBase.java:179)
at org.eclipse.birt.report.model.util.ResourceLocatorImplBase.findResource(ResourceLocatorImplBase.java:80)
at org.eclipse.birt.report.model.core.ModuleImpl.findResource(ModuleImpl.java:1181)
at org.eclipse.birt.report.model.parser.IncludedLibrariesStructureListState$IncludedLibraryStructureState.end(IncludedLibrariesStructureListState.java:99)
at org.eclipse.birt.report.model.util.XMLParserHandler.endElement(XMLParserHandler.java:177)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:94)
at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.java:81)
at org.eclipse.birt.report.model.core.DesignSessionImpl.openDesign(DesignSessionImpl.java:293)
at org.eclipse.birt.report.model.api.SessionHandleImpl.openDesign(SessionHandleImpl.java:257)
at org.eclipse.birt.report.model.api.SessionHandle.openDesign(SessionHandle.java:1)
at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:136)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.getReportDesignHandle(ReportEngineHelper.java:211)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:223)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:156)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:307)
at br.com.ipm.report.servlet.WebReport.doPost(WebReport.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:199)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
cidc1ykv

cidc1ykv1#

只是胡乱猜测:这可能是由于
a)安全性增强以避免访问任意文件b)资源路径设置不正确
请注意,当报表(或中继程式库)尝试开启程式库est_report_library_base.rptlibrary时,就会发生错误。这表示报表本身已顺利找到。

woobm2wo

woobm2wo2#

问题是,当我在报告中传递库的相对路径时,它试图采用项目的根路径,而由于我的根是“/WEB-INF/classes”,因此无法返回两个以上的级别,从而生成错误,感谢您的帮助。😅

相关问题