Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 310512

Summary: Getting "Premature End of File exception" when running BIRT report on Safari browser.
Product: z_Archived Reporter: Prakarsha <prakarsha_khandre>
Component: BIRTAssignee: Birt-ReportViewer <Birt-ReportViewer-inbox>
Status: RESOLVED WORKSFORME QA Contact: Xiaoying Gu <bluesoldier>
Severity: critical    
Priority: P3 CC: afarrell, benny.meyns, bluesoldier, chris.keller, mpsc.analysts, sokann, wim.jongman, zqian
Version: unspecified   
Target Milestone: 3.7.0   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: Obsolete
Attachments:
Description Flags
screenshot of the exception seen none

Description Prakarsha CLA 2010-04-26 13:51:26 EDT
Build Identifier: BIRT version 2.5.2

Using Safari browser, I created a new BIRT LIST report. After saving the report, run it with Safari browser.

ACTUAL RESULTS:
Shortly after the BIRT viewer initialized I got an exception:
Get exception: Prematrure end of file.  [See attached screen shot.]

EXPECTED RESULTS:
Should have seen a list report showing all records of the test form.

Cannot seem to run BIRT report on Safari, this is a potential blocker 

Reproducible: Always

Steps to Reproduce:

Using Safari browser, I created a new BIRT LIST report. After saving the report, run it with Safari browser.

ACTUAL RESULTS:
Shortly after the BIRT viewer initialized I got an exception:
Get exception: Prematrure end of file.  [See attached screen shot.]

EXPECTED RESULTS:
Should have seen a list report showing all records of the test form.

Cannot seem to run BIRT report on Safari, this is a potential blocker
Comment 1 Prakarsha CLA 2010-04-26 13:54:41 EDT
Created attachment 166110 [details]
screenshot of the exception  seen
Comment 2 Zhiqiang Qian CLA 2010-05-05 03:50:42 EDT
Is this only for Safari 3? Can you try Safari 4.x?
Comment 3 ChrisK CLA 2010-05-12 15:00:53 EDT
I have the same issue in Safari 4 on Windows XP as well as on Chrome (both are webkit based browsers). The viewer and reports work fine in firefox and internet explorer.  Additionally in my case when the BIRT viewer is deployed on tomcat the viewer and reports work fine in all 4 browsers, but not when the viewer is deployed in weblogic or websphere.  I am not sure what the connection is, but that is what I have observed.
Comment 4 Prakarsha CLA 2010-05-12 15:02:52 EDT
(In reply to comment #2)
> Is this only for Safari 3? Can you try Safari 4.x?

I see this exception on safari 3 only with safari 4.x... i see SAX exception
Comment 5 nicholas-karl CLA 2010-05-21 15:17:37 EDT
I am getting the same error.
I am using Konqueror 3.3.1-13.el4_8.1 (using KDE 3.3.1-17.el4_8.1 Red Hat)
Comment 6 Yap Sok Ann CLA 2010-07-27 08:07:26 EDT
A workaround is to comment out lines 668 and 669 of webcontent/birt/ajax/lib/prototype.js

Before commenting out the lines, Chrome will send Content-type as "application/x-www-form-urlencoded, text/xml; charset=UTF-8", which causes the exception.

After commenting out the lines, Chrome will send Content-type as "text/xml; charset=UTF-8", like other well-behaved browsers :)

The prototype.js shipped with BIRT report seems rather old though, as that part of the code has been modified in version 1.5.0_rc0 more than 4 years ago.
Comment 7 Yap Sok Ann CLA 2010-07-28 02:16:25 EDT
Chromium bug report related to this: http://code.google.com/p/chromium/issues/detail?id=44438
Comment 8 Xiaoying Gu CLA 2010-08-19 00:16:30 EDT
I can not reproduce this issue with BIRT 2.5.2 RCP designer wich Sarafi 3.2.3 version and Sarafi 5.0 version.
Comment 9 Xiaoying Gu CLA 2010-11-02 04:03:36 EDT
Set as worksforme based on Comment #8.

Please feel free to reopen if there is any issue.
Comment 10 Yap Sok Ann CLA 2010-11-02 05:14:33 EDT
How exactly did you test BIRT 2.5.2 RCP designer with Safari? No matter what I set in the Preferences (e.g. Use external web browser -> Firefox), the "Preview" tab and the "View Report in Web Viewer" button always display the report using IE control.
Comment 11 Xiaoying Gu CLA 2010-11-03 06:52:13 EDT
(In reply to comment #10)
> How exactly did you test BIRT 2.5.2 RCP designer with Safari? No matter what I
> set in the Preferences (e.g. Use external web browser -> Firefox), the
> "Preview" tab and the "View Report in Web Viewer" button always display the
> report using IE control.

1. Try Preference -> "Report Design" -> Preview -> Tick "Always use external browsers" 
2. Click the "Web Browser" link under option "Always use external browsers". 
   Choose "Use external Web Browser". Add Safari/Chrome/Firefox if they are not listed in the browser list. And tick on the browser you like.
Comment 12 Yap Sok Ann CLA 2010-11-08 02:58:17 EST
Thanks for the instructions. I can confirm that Chrome and Safari work fine with BIRT 2.5.2 RCP designer.

This bug looks like a combination of webkit based browsers and certain application servers, i.e.

jetty (used by RCP designer) - OK
tomcat (tested by ChrisK) - OK
weblogic (tested by ChrisK) - Failed
websphere (tested by ChrisK) - Failed
resin (tested by me) - Failed

I think weblogic/websphere/resin have problem dealing with the Content-type sent by webkit based browsers, when using the 4 years old prototype.js.
Comment 13 Xiaoying Gu CLA 2010-11-08 03:25:58 EST
(In reply to comment #12)
> Thanks for the instructions. I can confirm that Chrome and Safari work fine
> with BIRT 2.5.2 RCP designer.
> 
> This bug looks like a combination of webkit based browsers and certain
> application servers, i.e.
> 
> jetty (used by RCP designer) - OK
> tomcat (tested by ChrisK) - OK
> weblogic (tested by ChrisK) - Failed
> websphere (tested by ChrisK) - Failed
> resin (tested by me) - Failed
> 
> I think weblogic/websphere/resin have problem dealing with the Content-type
> sent by webkit based browsers, when using the 4 years old prototype.js.

The weblogic issue has been fired in https://bugs.eclipse.org/bugs/show_bug.cgi?id=326295.
Comment 14 Wim Jongman CLA 2011-05-17 18:49:56 EDT
Hi,

I have just deployed 2.6.2 viewer in Websphere Application Server Express 7. 

I get the SAX Parse error with Chrome 11.0.696.68 but not with internet explorer 8.0.7600.16385
Comment 15 Anthony Farrell CLA 2011-10-19 13:50:39 EDT
Can I get some details on what the fix is?, we cannot upgrade to BIRT 3.7 as yet!
Comment 16 Zhiqiang Qian CLA 2011-10-19 21:49:11 EDT
(In reply to comment #15)
> Can I get some details on what the fix is?, we cannot upgrade to BIRT 3.7 as
> yet!

Please check the workaround in comment 6.
Comment 17 Anthony Farrell CLA 2011-10-20 05:34:35 EDT
Just to summarize, when using chrome/Tomcat to view our BIRT content I do not get any errors, I only get the "premature end of file error" when using chrome against our app deployed on our supported application  servers (websphere or weblogic). 

I have removed the two lines in comment 6 and tested against a Websphere environment ( I have not tested Weblogic or re-verified Tomcat again, I will do this in due course).  Our BIRT reports seem to be running now!

Again, just to confirm this is an early feedback update, namely:
  1. I hacked the prototype.js underneath the hood in Websphere, i.e. I did not redeploy our application, I changed the file underneath the exploded EAR directories in WAS

  2. When I repackage our EAR's again, I anticipate our BIRT report should remain in working order.

thanks again for your help.
Anthony.
Comment 18 Anthony Farrell CLA 2011-10-20 06:26:59 EDT
Is a newer version of prototype.js being used with BIRT 3.7 ?  

The open source Prototype.js project has released version 1.7, is 1.7 being released with BIRT 3.7?


I guess that the workaround of commenting out lines 668 and 669 of
webcontent/birt/ajax/lib/prototype.js  is not release with BIRT 3.7 ?

Many thanks for your help to date.