Community
Participate
Working Groups
Build Identifier: Build id: 20100917-0705 My environment is: 1. Windows Vista Home Premium / Windows Seven Home Premium 64x 2. Java version "1.6.0_21" / Java version "1.6.0_23" (both 32x) 3. Eclipse for RCP and RAP Developers Version: Helios Service Release 1 Build id: 20100917-0705 4. Internet Explorer 8.0.6001.18999 5. Mozilla Firefox 4.0b8 6. Google Chrome 8.0.552.224 7. Firewall is disabled for the tests. 8. BIRT Version: 2.6.1.v20100709-7m9f7NFT0z0-Im5IWab4F6 Build id: v20100915-1750 Reproducible: Always Steps to Reproduce: 1. Use a RCP with a View that will display a BIRT report. See: http://wiki.eclipse.org/RCP_Example_%28BIRT%29_2.1 2. In the createPartControl method, use the following code to display the BIRT report: // code snippet from BIRT integration with RCP example Browser browser = new Browser(parent, SWT.NONE); // Use the filename of your report HashMap myparms = new HashMap(); HashMap emitmap = new HashMap(); myparms.put("SERVLET_NAME_KEY", "frameset"); myparms.put("FORMAT_KEY", "html"); // myparms.put("RESOURCE_FOLDER_KEY", "c:/myresources"); myparms.put("ALLOW_PAGE", "false"); myparms.put("SHOW_PARAMETER_PAGE", "false"); // Report Parameters emitmap.put("Top Count", "6"); emitmap.put("Top Percentage", "15"); myparms.put("EMITTER_OPTIONS_KEY", emitmap); // myparms.put("MAX_ROWS_KEY", "500"); WebViewer.display(reportUrlPath, browser, myparms); 3. Run the RCP application, open the View and the report will be displayed as expected within the view. 4. Now, click on "Print Report" toolbar command and choose "HTML print format". The report is open in a Internet Explorer window with a exception "The viewing session is not available or has expired". 5. The complete stack trace: -- cut here -- org.eclipse.birt.report.exception.ViewerException: The viewing session is not available or has expired. at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGet(BaseReportEngineServlet.java:158) at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doPost(BaseReportEngineServlet.java:224) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.eclipse.birt.report.servlet.BaseReportEngineServlet.service(BaseReportEngineServlet.java:116) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) -- cut here --
My observations are: 1. My system default browser is not Internet Explorer, it's Firefox. Even if I change my system default browser to Chrome, the report always opens with IE. 2. If I copy the original url that was first opened by IE and paste it into Firefox or Chrome, the report is opened normally without any exceptions. 3. The same happens if I choose PDF print format instead HTML. So, I did some tests. Test-1. --- I changed the browser used: Window->preferences->Report Design->Preview->Always use external browsers check box below it is a link to set the browser preference. I set the default browser to Firefox. I also set the host to localhost and the port to zero using the Preview->Preview Server entry. Conclusion: the same exception occurs. Test-2. --- If I change the following code from this: WebViewer.display(fileUrlPath, browser, myparms); to this code: WebViewer.display(fileUrlPath, myparms); Of course, my view isn't opening the report. However, the report viewer is opening straight to the browser, not running IE, but running Firefox, the default external browser defined in Preferences now. Next, in the external browser on WebViewer toolbar, if I click on Print Report command, a new Firefox window is open with a report print version and the print dialog pops up. This way, all works! Not as I would like, however! Test-3. --- Now, using WebViewer.display(fileUrlPath, browser, myparms) again. As the server defined in Preferences is localhost, I included it (localhost) in the IE trusted sites zone, or as local intranet site. Doing that, the IE is opening and the report is displayed with no exceptions. But only IE is the browser called yet, even if Firefox is the external browser defined in Preferences. Final comments [just a clue]: --- This seems to be a IE policy with iframe, cookies and cross-site. [quote] Instead of creating and uploading privacy policies to your sites, you can serve a “compact policy,” i.e. a “p3p” HTTP header, e.g.: “IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT”. A policy generator can produce one instead of an XML file. [/quote] (from http://aspnetresources.com/blog/frames_webforms_and_rejected_cookies) Other links: [Cross-domain problem] http://thedesignspace.net/MT2archives/000472.html [Cross Domain IFrame and Cookie Issues with IE7] http://thefrontiergroup.com.au/blog/2009/02/cross-domain-iframe-and-cookie-issues-with-ie7/
According to the post on birt-exchange, this issue is a common issue and have been fixed in the code of rcp example. http://www.birt-exchange.org/org/forum/index.php/topic/21288-the-viewing-session-is-not-available-or-has-expired/page__pid__72156__st__0&#entry72156 This seems to be a common problem http://www.eclipsezone.com/eclipse/forums/t90733.html