Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334410 - [HTMLReportEmitter] Invalid byte 1 of 1-byte UTF-8 sequence
Summary: [HTMLReportEmitter] Invalid byte 1 of 1-byte UTF-8 sequence
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 trivial with 1 vote (vote)
Target Milestone: 3.7.0 M7   Edit
Assignee: Gang Liu CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
: 352281 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-14 13:41 EST by Thomas Küstermann CLA
Modified: 2011-11-07 21:31 EST (History)
2 users (show)

See Also:


Attachments
Sample report with background image (2.07 KB, application/x-zip-compressed)
2011-01-14 13:43 EST, Thomas Küstermann CLA
no flags Details
Stacktrace (3.48 KB, text/plain)
2011-01-14 13:45 EST, Thomas Küstermann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Küstermann CLA 2011-01-14 13:41:30 EST
Build Identifier: v20100915-1750

We're actually faced with lots of 'Invalid byte 1 of 1-byte UTF-8 sequence' exceptions in our server logs because of the background image handling in HTMLReportEmitter.handleStyleImage( String uri, boolean isBackground ).

The responsible code fragment tries to convert a non SVG image to JPEG using Batik. This fails with the mentioned error message (printed out by Batik) and fills up our log files. This is a cosmetic problem but very annoying.

Reproducible: Always

Steps to Reproduce:
1. Create a report with a background image
2. Use HTMLRenderOption to render the report
Comment 1 Thomas Küstermann CLA 2011-01-14 13:43:26 EST
Created attachment 186839 [details]
Sample report with background image

attached sample report
Comment 2 Thomas Küstermann CLA 2011-01-14 13:45:08 EST
Created attachment 186840 [details]
Stacktrace

attached stacktrace
Comment 3 Gang Liu CLA 2011-05-16 04:59:24 EDT
fixed
Comment 4 Xiaoying Gu CLA 2011-05-16 05:01:59 EDT
Verified in 3.7.0M7
Comment 5 Xiaoying Gu CLA 2011-07-17 22:37:36 EDT
*** Bug 352281 has been marked as a duplicate of this bug. ***
Comment 6 Wael Mashal CLA 2011-07-18 01:42:54 EDT
Hi

can you give me how you solve it then I can add the new code on the html emitter on 2.6.2 and re compile it , i need this solution because this exception make a problem in my case .

thanks
Comment 7 Madhav Suram CLA 2011-11-07 11:13:19 EST
(In reply to comment #4)
> Verified in 3.7.0M7

Hi Xiaoying Gu,

Could you please point us to the changes which were made to fix this issue and if the same changes can be made in 2.6.2 for our internal use? The server logs are currently filled up with the error message and is a big problem.

Thanks & regards,
Madhav
Comment 8 Gang Liu CLA 2011-11-07 21:31:46 EST
This change is made in HTMLReportEmitter.java:

Please find the method: 
public String handleStyleImage( String uri, boolean isBackground )

and replace the line:
byte[] buffer = SvgFile.transSvgToArray( uri );

to 

byte[] buffer = EmitterUtil.getImageData( uri );

then it should work.