我有以下问题,我想知道原因可能在哪里。我正在尝试从服务器conf
的文件夹中加载资源。JBoss
final String REPORT_DESIGN = "report_name.rptdesign"; //xml file
templateIS = Thread.currentThread().getContextClassLoader().getResourceAsStream(REPORT_DESIGN);
这很好用,我什至可以将流写入文本文件并得到正确的结果。但问题是当我试图将输入流传递给Birt引擎时,我总是得到org.eclipse.birt.report.engine.api.EngineException: The design file <stream> has error and can not be run
.
我也尝试过/
文件开头的版本。
当我尝试从我的项目的资源中加载相同的文件时(所以从带有 的 jar 文件中this.getClass().getResourceAsStream
),它起作用了。我也JBoss
以同样的方式从同一个文件夹中读取属性文件,它也可以工作。我真的被这个卡住了,什么可能导致这种奇怪的错误?