Я пытаюсь генерировать отчеты, используя prpt из Java-кода.Но это не удается при записи данных в PDF-файл, похоже на проблему JAR.
Примечание. Вызов файла prpt из задания Kettle.
Я пытался исключить из проекта все xml-apis
maven-зависимости.
KettleEnvironment.init();
JobMeta jobmeta = new JobMeta(fileName, repository);
Job job = new Job(repository, jobmeta);
job.initializeVariablesFrom(null);
job.getJobMeta().setInternalKettleVariables(job);
for(Entry<String, String> param: params.entrySet()) {
jobmeta.setParameterValue(param.getKey(), param.getValue());
}
job.copyParametersFrom(jobmeta);
job.activateParameters();
job.execute(0, null);
job.waitUntilFinished();
job.setFinished(true);
Сообщение об ошибке:
Caused by: org.pentaho.reporting.engine.classic.core.ReportDataFactoryException: Caught Kettle Exception: Check your configuration
at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleDataFactory.queryData(KettleDataFactory.java:100)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStaticInternal(CompoundDataFactory.java:172)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:154)
at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryInternal(CachingDataFactory.java:408)
at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryStatic(CachingDataFactory.java:151)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStaticInternal(CompoundDataFactory.java:168)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:154)
at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryData(CompoundDataFactory.java:67)
at org.pentaho.reporting.engine.classic.core.states.datarow.DefaultFlowController.performQueryData(DefaultFlowController.java:256)
at org.pentaho.reporting.engine.classic.core.states.datarow.DefaultFlowController.performQuery(DefaultFlowController.java:192)
at org.pentaho.reporting.engine.classic.core.states.process.ProcessState.initializeForMasterReport(ProcessState.java:318)
at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.prepareReportProcessing(AbstractReportProcessor.java:442)
at org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor.processReport(AbstractReportProcessor.java:1433)
at org.pentaho.reporting.engine.classic.core.modules.gui.pdf.PdfExportTask.run(PdfExportTask.java:134)
at org.pentaho.di.trans.steps.pentahoreporting.PentahoReportingOutput.processReport(PentahoReportingOutput.java:278)
... 3 more
Caused by: java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
at org.pentaho.reporting.libraries.base.util.XMLParserFactoryProducer.createSecureDocBuilderFactory(XMLParserFactoryProducer.java:36)
at org.pentaho.reporting.libraries.xmlns.parser.DomTreeResourceFactory.create(DomTreeResourceFactory.java:75)
at org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.create(DefaultResourceManagerBackend.java:225)
at org.pentaho.reporting.libraries.docbundle.BundleResourceManagerBackend.create(BundleResourceManagerBackend.java:142)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:382)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:334)
at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleTransFromFileProducer.loadTransformation(KettleTransFromFileProducer.java:124)
at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.AbstractKettleTransformationProducer.performQuery(AbstractKettleTransformationProducer.java:232)
at org.pentaho.reporting.engine.classic.extensions.datasources.kettle.KettleDataFactory.queryData(KettleDataFactory.java:96)