JasperStudio extension dependency error
Description
Acceptance / Success Criteria
Attachments
- 02 Apr 2018, 08:44 PM
Lucidchart Diagrams
Activity
Alejandro Galue April 17, 2018 at 4:03 PM
Thanks for the details.
I think that as there are no more ClassNotFoundExceptions, we can say that this particular problem is fixed with the PR.
Dealing with the complexity of working with JasperStudio, the missing feature to make the JasperStudio UI nicer like with JDBC queries, and dealing with sub-reports fall outside the scope of this.
I vote for merging the PR.
Markus von Rüden April 17, 2018 at 3:59 PM
The "Read Fields" functionality is not supported by the JasperStudio measurements implementation, as stated in the docs. The fields values are documented there as well (https://docs.opennms.org/opennms/branches/develop/guide-admin/guide-admin.html#ga-database-reports-usage-jaspersoft-studio).
I verified the report, and it is working for me. I don't get the ClassNotFoundException anymore.
I am also able to verify that running the overall report works.
Running other reports, which use the measurements API also show data when running via JasperReports.
However debugging or manually running a subreport is a totally different task, and may be quite hard to achieve. Please ensure that all parameters (go to PREVIEW and force the view of the parameters) and ensure all are populated properly. What "properly" means depends on the context of the report and is usually hard to determine, but can be done by reading the parent report.
I did not go through the trouble of getting the subreport to work manually. If this needs to be done, please let me know and I will spent more time on this.
Alejandro Galue April 11, 2018 at 3:47 PM
I've compiled your branch, then I've started to collect data from out default gateway, and verified that the Total Bytes Transferred by Interface report shows data from the WebUI. Then, I've started JasperStudio, added the extension library from the contrib directory (using your branch), restarted JasperStudio and I've loaded the TotalBytesTransferredByInterface.jrxml from the etc directory (using your branch). When I try to preview the report, I'm seeing the following:
net.sf.jasperreports.engine.JRException: javax.xml.bind.DataBindingException: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; Premature end of file.]
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:537)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$20(ReportControler.java:512)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:393)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: javax.xml.bind.DataBindingException: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; Premature end of file.]
at javax.xml.bind.JAXB.unmarshal(JAXB.java:226)
at org.opennms.netmgt.jasper.measurement.MeasurementDataSource.<init>(MeasurementDataSource.java:56)
at org.opennms.netmgt.jasper.measurement.remote.RemoteMeasurementDataSourceWrapper.createDataSource(RemoteMeasurementDataSourceWrapper.java:90)
at org.opennms.netmgt.jasper.measurement.MeasurementQueryExecutor.createDatasource(MeasurementQueryExecutor.java:77)
at org.opennms.netmgt.jasper.measurement.MeasurementQueryExecutor.createDatasource(MeasurementQueryExecutor.java:46)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1129)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:696)
at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:437)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:548)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:732)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; Premature end of file.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:563)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:249)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:276)
at javax.xml.bind.JAXB.unmarshal(JAXB.java:223)
... 15 more
Caused by: org.xml.sax.SAXParseException; Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(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 com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
... 18 more
Now, if I add the subreport (the one that actually uses the measurements API), then open the Dataset and Query Dialog and click on "Read Fields", I'm seeing this:
java.lang.NumberFormatException: For input string: "null"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.valueOf(Long.java:803)
at com.sun.xml.internal.bind.DatatypeConverterImpl._parseLong(DatatypeConverterImpl.java:118)
at org.opennms.netmgt.measurements.model.QueryRequest_JaxbXducedAccessor_start.parse(TransducedAccessor_method_Long.java:50)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.startElement(StructureLoader.java:195)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ProxyLoader.startElement(ProxyLoader.java:45)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:559)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:538)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:153)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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 com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:276)
at javax.xml.bind.JAXB.unmarshal(JAXB.java:223)
at org.opennms.netmgt.jasper.helper.MeasurementsHelper.unmarshal(MeasurementsHelper.java:99)
at org.opennms.netmgt.jasper.measurement.remote.RemoteMeasurementDataSourceWrapper.createDataSource(RemoteMeasurementDataSourceWrapper.java:72)
at org.opennms.netmgt.jasper.measurement.MeasurementQueryExecutor.createDatasource(MeasurementQueryExecutor.java:77)
at org.opennms.netmgt.jasper.measurement.MeasurementQueryExecutor.createDatasource(MeasurementQueryExecutor.java:46)
at com.jaspersoft.studio.data.jdbc.JDBCFieldsProvider.getFields(JDBCFieldsProvider.java:79)
at com.jaspersoft.studio.data.jdbc.JDBCDataAdapterDescriptor.getFields(JDBCDataAdapterDescriptor.java:75)
at com.jaspersoft.studio.property.dataset.dialog.DataQueryAdapters.doGetFields(DataQueryAdapters.java:396)
at com.jaspersoft.studio.data.designer.AQueryDesignerContainer$1.run(AQueryDesignerContainer.java:53)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Thoughts ?
Markus von Rüden April 9, 2018 at 11:47 AM
Originally I used the spring jars as dependencies, but the build failed then. When switching to the org.apache.servicemix spring bundles, I forgot to add the dao bundle (spring-tx), but added the aop (spring-aop) bundle twice. Oops.
This PR should fix your issue: https://github.com/OpenNMS/opennms/pull/1923
Sorry for your inconvenience.
Alejandro Galue April 2, 2018 at 8:44 PM
I've tried the latest compilation of foundation-2017 and develop on my Mac, and I'm getting the dependency error (see the screenshot).
I've compiled OpenNMS using ./assemble.pl -p fulldir
and then imported the external JAR from the contrib directory.
I'm using JasperSoft Studio 6.3.0 (the same version of the JasperReport library used on both versions of OpenNMS I've tried).
I even tried importing the JAR from a VM with the latest RPMs from develop (build 1326), and I got the same problem.
Details
Assignee
Markus von RüdenMarkus von Rüden(Deactivated)Reporter
Ronny TrommerRonny TrommerLabels
Sprint
NoneFix versions
Affects versions
Priority
Major
Details
Details
Assignee
Reporter
Labels
Sprint
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

When you try to add the JasperStudio extension library with dependencies, it is not possible to use the measurements API cause of missing dependencies.