{"id":2186,"date":"2010-12-03T16:46:41","date_gmt":"2010-12-03T11:16:41","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=2186"},"modified":"2022-01-13T14:05:01","modified_gmt":"2022-01-13T08:35:01","slug":"malformedbytesequenceexception-with-grails-jasper-plugin-1-1-6","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/malformedbytesequenceexception-with-grails-jasper-plugin-1-1-6\/","title":{"rendered":"MalformedByteSequenceException with Grails jasper plugin 1.1.6"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>I was facing a lot of problems with creating pdf reports using jasper plugin 1.1.6 in grails, Though I had earlier worked with 0.9.5 and 0.9.7 versions of the plugin with a lot of ease but some how 1.1.6 version of plugin was not generating reports\u00a0 it always ended up throwing <strong>MalformedByteSequenceException<\/strong>: Invalid byte 1 of 1-byte UTF-8 sequence.<\/p>\n<p>[java]com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.<br \/>\n at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)<br \/>\n at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:554)<br \/>\n at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)<br \/>\n at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.arrangeCapacity(XMLEntityScanner.java:1619)<br \/>\n at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipString(XMLEntityScanner.java:1657)<br \/>\n at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:193)<br \/>\n at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)<br \/>\n at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)<br \/>\n at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)<br \/>\n at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)<br \/>\n at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)<br \/>\n at org.apache.commons.digester.Digester.parse(Digester.java:1647)<br \/>\n at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:241)<br \/>\n at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)<br \/>\n at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)<br \/>\n at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:199)<br \/>\n at net.sf.jasperreports.engine.JasperCompileManager$compileReport.call(Unknown Source)<br \/>\n at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)<br \/>\n at java.lang.Thread.run(Thread.java:662)[\/java]<\/p>\n<p>I tried various things like changing the header of the jrxml file, adding new attributes in jasperReport tag and changing encoding type but to no Avail. Then I tried generating report without the .jasper files and deleted all jasper files except for sub-reports (sub-reports need to be in a pre-compiled state for the plugin to work)\u00a0 and thing started working. For some strange reason the plugin was throwing exception when jasper report was available but if the report was compiled on the fly the plugin had no trouble with it. I am not sure what may be the reason may be I-report or something, but I got a move on. Hope You will too.<\/p>\n<p>With Regards<\/p>\n<p>Sachin Anand<\/p>\n<p>sachin[at]intelligrape[dot].com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, I was facing a lot of problems with creating pdf reports using jasper plugin 1.1.6 in grails, Though I had earlier worked with 0.9.5 and 0.9.7 versions of the plugin with a lot of ease but some how 1.1.6 version of plugin was not generating reports\u00a0 it always ended up throwing MalformedByteSequenceException: Invalid [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1},"categories":[7],"tags":[159,469,470,468],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2186"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=2186"}],"version-history":[{"count":1,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2186\/revisions"}],"predecessor-version":[{"id":54643,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2186\/revisions\/54643"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=2186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=2186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=2186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}