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

ERROR--Invalid byte 2 of 3-byte UTF-8 sequence.


gsunil15

Recommended Posts

Hi All,

  I am working on IReport 3.0.0.

  When I am trying to save the Jrxml content in to DataBase it is giving the error.

net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: Invalid byte 2 of 3-byte UTF-8 sequence.
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)

My Jrxml contains below Query :

 SELECT
     application."APPLICATION_NUMBER" AS application_APPLICATION_NUMBER,
     person."PERSON_NUMBER" AS person_PERSON_NUMBER,
     person."FIRST_NAME" AS person_FIRST_NAME,
     person."LAST_NAME" AS person_LAST_NAME,
     application."PERSON_NUMBER" AS application_PERSON_NUMBER,
     application."APPLICATION_DATE" AS application_APPLICATION_DATE

FROM
     "dbo"."application" application,
         "dbo"."person" person

WHERE

     application.person_number = person.person_number
AND application.application_date>=${desde a data}
 and application.application_date<=${até à data}

 

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I was reading the content of Jrxml file and saving the content in the form of  byte arry in to the Database .

Then reading the content from the DB and forming the Jasperdesign object.   While  creating the japerdesign object getting the error---Invalid byte 2 of 3-byte UTF-8 sequence.

find the attached Jrxml file .

 please find the below code: 

byte

 

[] reportContent=null;   try{new ByteArrayInputStream(reportContent);

 

reportContent = ReportTemplate.getReportContent();        ( iam uisng hibernate, so Iam using Vo object of Report template table)

reportStream =

 

JasperDesign jasperDesign = JRXmlLoader.load(reportStream);------getting the error at this line.

 

JRDesignQuery jrd =(JRDesignQuery)jasperDesign.getQuery();

Link to comment
Share on other sites

My Query contains some Portuguese characters also,

  Is there any problem with portuguese characters while parsing the Jrxml content and constructing the Japser design object.

 

Please find the source code below.

 

 Regards

Sunil kumar.G

Code:
byte [] reportContent=null;   try{reportContent = ReportTemplate.getReportContent();  ( iam uisng hibernate, so Iam using Vo object of Report template table)reportStream =new ByteArrayInputStream(reportContent); JasperDesign jasperDesign = JRXmlLoader.load(reportStream);------getting the error at this line. JRDesignQuery jrd =(JRDesignQuery)jasperDesign.getQuery();
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...