1

我正在尝试使用带有 mongodb 的 java 中的 pentaho 生成报告。

我的代码是

try {
 ClassLoader classloader = this.getClass().getClassLoader();
 URL reportDefinitionURL =
 classloader.getResource("reports/TestSalesOrderReportOuputValues.prpt");
 ResourceManager resourceManager = new ResourceManager();
 resourceManager.registerDefaults();
 Resource directly = resourceManager.createDirectly(
 reportDefinitionURL, MasterReport.class);
 return (MasterReport) directly.getResource();
 } catch (ResourceException e) {
e.printStackTrace();
}

越来越像,

org.pentaho.reporting.libraries.resourceloader.ResourceCreationException: Unable to parse the document: ResourceKey{schema=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader, identifier=content.xml, factoryParameters={org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository}=org.pentaho.reporting.libraries.repository.zipreader.ZipReadRepository@854e63b, org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository-loader}=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader@638a3572}, parent=ResourceKey{schema=org.pentaho.reporting.libraries.resourceloader.loader.URLResourceLoader, identifier=file:/D:/java_works/nirvahak-wrokspace/samples/sample-erp/target/classes/reports/manogoTestVenu.prpt, factoryParameters={}, parent=null}}

请任何人都可以帮助我。

4

1 回答 1

0

当经典引擎未正确启动时,可能会引发此异常。首先启动经典引擎。

ClassicEngineBoot.getInstance().start();

于 2013-08-16T20:32:41.463 回答