Report definition

Started by Sch.Donat, November 19, 2019, 02:06:06 PM

Previous topic - Next topic

Sch.Donat

Hi all!

I'm trying to compile and run EPP report definition from attached samples in https://www.netxms.org/forum/installation/install-report-server/msg16296/#msg16296. I got it to compile with maven (had to make some changes to pom.xml), but it can't run. The first error was that it couldn't find the report.DataSource's constructer with (net.sf.jasperreports.engine.JRDataset, java.util.Map) parameters, so I changed the existing one to:

public DataSource(JRDataset dataset, Map<String, ? extends JRValueParameter> parameters){
        super(dataset, parameters);
}


in EPP's DataSource.java. After this, for a few time I got null pointer exception (unfortunately I don't have the log for that), but now I'm getting:

12:36:06.760 [quartzScheduler_Worker-1] ERROR c.r.r.s.impl.FileSystemReportManager - Can't load compiled report
net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: main.jasper
        at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:127) ~[jasperreports-6.3.1.jar:6.3.1]
        at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:116) ~[jasperreports-6.3.1.jar:6.3.1]
        at com.radensolutions.reporting.service.impl.FileSystemReportManager.loadReport(FileSystemReportManager.java:129) [reporting-server-2.2.16.jar:na]
        at com.radensolutions.reporting.service.impl.FileSystemReportManager.execute(FileSystemReportManager.java:282) [reporting-server-2.2.16.jar:na]
        at com.radensolutions.reporting.job.GeneratorJob.execute(GeneratorJob.java:33) [reporting-server-2.2.16.jar:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.1.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:na]
Caused by: java.io.FileNotFoundException: main.jasper
        ... 7 common frames omitted


I don't know what causes the problem, I guess there were some changes in reporting server.

So my question is: Should I just use SQL data source, or is it possible to use java data source and if so, where can I find some sample that works, to examine it?
I'm using NetXMS version 2.2.16 (both server and reporting server).
Attached is the pom.xml

p.s.: The Data Collection Configuration definition seems to work just fine.

Edit:
I forgot to mention that I also had to modify processAlarms method, because EventProcessingPolicyRule.getActions() return a List<ActionExecutionConfiguration> not a List<Long>.

Best regards,
Sch.Donat