Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: accessing report by JSP getting exception

  1. #1
    Join Date
    Dec 2009
    Posts
    12

    Default accessing report by JSP getting exception

    Hi,
    I developed one report in which i passed date from my JSP it working fine if Database having some data on respective date ....if in particular date if database not having any data then my jsp showing Exception
    In Report designer its showing blank report ......I wanted same thing on my JSP .

    Exception is

    java.lang.IllegalStateException: getOutputStream() has already been called for this response org.apache.catalina.connector.Response.getWriter(Response.java:607) org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196) org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125) org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118) org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:179) org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:116) org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:76) org.apache.jsp.global_005ftab_005fdata_jsp._jspService(org.apache.jsp.global_005ftab_005fdata_jsp:172) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) I am just calling my PRPT file HtmlReportUtil.createStreamHTML(report,response.getOutputStream());Can any body suggest whats issue and how to solveThanks in Advance

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    getOutputStream() has already been called for this response

    You cannot call ServletResponse#getOutputStream() twice. In JSPs this is already called by the JSP itself and should be availble as extra variable (heck, it has been ages since I worked with JSPs, check the Servlet/JSP-Standard for where it is stored).

    Unless your report produces HTML, it is also generally a bad idea to combine reporting engine output and HTML output from the JSP. Usually it is better to use a Servlet to handle requests that may produce binary data (as reports usually do).
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Dec 2009
    Posts
    12

    Default

    Hi Taqua,
    We knew that you can't call twice #getoutputstream on response object. But what really surpises me that this is happening only when the reports query has no rows in its result. When it has rows in its results, this error doesn't come.
    Won't be it advisible to add another overloaded method HtmlReportUtil.createStreamHTML(report, PrintWriter out) like in previous versions. Here we could pass implicit JSP printwriter out object?

  4. #4
    Join Date
    Dec 2009
    Posts
    12

    Default

    Hi Taqua,
    I am facing same problem with servlet also.

    If database having no data on corresponding date then it gives same exception


    Thanks

  5. #5
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Well, I currently cannot access your harddisk. So I cant see your code and also cannot see the exceptions you get. Once the CIA approved my support desk status and allows me full access to other persons computers, I probably have more luck. But most of the people at the headquarter are already on vacation, so this wont happen this year.

    Of course, you could alternatively provide more details on what you are doing and what exactly the exception is that you are getting. And version numbers help too.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.