[#5198] - Corruption converting .jasper to .jrxml

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

Category:
Bug report
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Major
Resolution:
Reopened
Component: Reproducibility:
Always
Assigned to:

When retrieving a .jasper report, as it writes to .jrxml the template is apparently getting written incorrectly. The following error is occurring (clipboard error button), and the template is irretrievable in other versions of ireport:

Error from clipboard:-------------------

Error loading the report template

Message:
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'paragraph'. No child element is expected at this point.
Level:
SEVERE
Stack Trace:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'paragraph'. No child element is expected at this point.
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:245)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87)
com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
cvc-complex-type.2.4.d: Invalid content was found starting with element 'paragraph'. No child element is expected at this point.
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
org.apache.commons.digester.Digester.parse(Digester.java:1647)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:241)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87)
com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

AttachmentSize
File Document.rtf1.85 MB
letsspin's picture
Joined: Apr 21 2011 - 7:43am
Last seen: 11 years 2 months ago

6 Comments:

#1

Also all my reports developed with iReport 4.0.2. have this error.
JaspserServer and iReport 4.0.0 won't import them and give this error:
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'paragraph'. No child element is expected at this point.

For me the workaround is to delete all the lines with " <paragraph lineSpacing="Single"/>" in it.
Then the JRXML file can be loaded in iReport 4.0 and also in the JasperServer.

#2

Since iReport 4.0.2. gives unusable JRXML files I switched to 4.0.0 version.
This version says there is a new version 4.0.2.
Since this is a major problem, since reports don't work anymore, perhaps the message of a new version should not appear until the 4.0.2. is compatible again with JapserServer 4.0

#3

If you need to keep the compatibility with an old version of JasperReports, you have to set the "Compatibility Mode" in the ireport options and set the compatibility to a specific version (4.0.1 should be enough).

Giulio

#4

Unless I'm reading the resolution wrong, it sounds like this will not be addressed programmatically.

To reiterate the issue, in v4.0.2 when I retrieve a .jasper file and iReport prompts to convert to .jrxml, the corruption comes through to the current version.

Please reconsider - this is more than just a compatibility issue with older versions. It is an issue that corrupts existing templates, and I can't see upgrading until it is resolved or there is a reasonable workaround.

#5

Hi letsspin, let me explain the problem from a different prospective.
iReport is strictly tied to JasperReports. So if you use iReport 4.0.2 to convert a jasper file to jrxml, you'll get a jrxml compatible with JasperReports 4.0.2. If you now need to use this jrxml with a previous version of jasperreports, you need to save it in a format compatible with the version of jasperreports you need, so what you have to do is to open the jrxml, set the compatibility mode in iReport and save it. At this point the new jrxml can be used with your application (i.e. JasperReports Server). What kind of improvement would you like to see?

Giulio

#6

Appreciate your patience here. I think it will become a moot point shortly - we are using Fishbowl Inventory, which shortly will be upgraded to use v4.0.2.

Feedback
randomness