Jump to content
We've recently updated our Privacy Statement, available here ×

net.sf.jasperreports.engine.JRException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException


bruessermann

Recommended Posts

Hello,

I made a definition of a Report using iReport 3.1. After saving and restarting IReport the designer gives in Error Message and don't show anything.

My XML-Reportdefinitions are in the attachment 1.

Thanks in advance for your help.

 

The Error message is:

Error loading the report template
 

Message:
    net.sf.jasperreports.engine.JRException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
Level:
    SEVERE
Stack Trace:
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
    net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:247)
    net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
    com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:85)
    com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:485)
    org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
    org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Invalid byte 2 of 3-byte UTF-8 sequence.
    com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:674)
    com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:398)
    com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
    com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanData(XMLEntityScanner.java:1242)
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanCDATASection(XMLDocumentFragmentScannerImpl.java:1644)
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970)
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    org.apache.commons.digester.Digester.parse(Digester.java:1647)
    net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)
    net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
    com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:85)
    com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:485)
    org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
    org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
 

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

There are some lines missing at the top of the jrxml that you attached. A test report that I constructed using IReport 3.1.0 nb has these lines at the very top of the page:

 

<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
 

 

If these are really not in the jrxml adding them might fix your problem.

 

Hope that this helps.

Link to comment
Share on other sites

  • 3 months later...

Hi

I have equal problem and tried add the lines to jrxml, but the problem persist.

All my  files in 3.1.2 have this problem. My header is

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="FacCobrar" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
 <parameter name="PV_ID_FACTURA" class="java.math.BigDecimal">
  <parameterDescription><![CDATA[Numero de Factura que se esta generando]]></parameterDescription>
  <defaultValueExpression><![CDATA[6200811]]></defaultValueExpression>
 </parameter>
 <queryString> 

Link to comment
Share on other sites

Other people have already got this trouble. One of them said that the trouble could be fixed by adding the plugin "XML and Schema". I did it and that fixed my problem.

Do a search on this forum with "UTF-8" and I think you will retreave all the threads about that.

With the next release (iReport NB 3.1.2) I get a similar problem but the fix seems not to work. For the moment, I consider this new release as unusable.

Link to comment
Share on other sites

iReport: 3.1.2 The same problem was solved adding parameter -Dfile.encoding=UTF-8 to the VM.

To add parameter edit etc/ireport.conf, modify 'default_options' parameter it should look like this:

   default_options="-J-Dfile.encoding=UTF-8 -J-Xms24m -J-Xmx64m"



Post Edited by Vitaly Rudensky at 12/15/08 08:13
Link to comment
Share on other sites

  • 1 month later...

vetal
Wrote:

iReport: 3.1.2 The same problem was solved adding parameter -Dfile.encoding=UTF-8 to the VM.

To add parameter edit etc/ireport.conf, modify 'default_options' parameter it should look like this:

   default_options="-J-Dfile.encoding=UTF-8 -J-Xms24m -J-Xmx64m"



Post Edited by Vitaly Rudensky at 12/15/08 08:13

Yes, it works well for iReport 3.1.3 too.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...