Jump to content
We've recently updated our Privacy Statement, available here ×
  • Exception getting dataset from cache


    mgeise
    • Version: v3.7.1, v3.7.0 Product: JasperReports® Server

    Summary

    [toc on_off::hide=1]

    This article provides troubleshooting tips related to receiving a Exception Getting Dataset from Cache error when running a report or dragging fields onto an Ad Hoc report in TIBCO JasperReports Server.


    Symptoms

    The following is a typical stack trace associated with this error:

    java.lang.RuntimeException: exception getting dataset from cache at
    com.jaspersoft.commons.semantic.dsimpl.memory.MemoryDataSet.getWorkingDataSet(MemoryDataSet.java:154)
    
    ...
    
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have
    an error in your SQL syntax; check the manual that corresponds to your MySQL
    server version for the right syntax to use near 'outer join `bugs` on
    (`sfdc_suppt_cases`.`BugERNumber__c` = `bugs`.`bug_id`)' at line 5

    Causes

    Typically, this issue is caused when a query has been generated that is not supported by the database associated with the datasource.

    • Example #1: A Full Outer Join is used with MySQL. MySQL does not support the full outer join syntax.

    • Example #2: In some scenarios where a custom DomEL/groovy function emits SQL referring to specific tables but the SQL generator doesn't know about those references (because they're not part of any DomEL expression), the SQL will only work when that table is referenced by something else - the referenced table does not appear in the FROM clause.

    • Example #3: The case of fields in the topic doesn't match the case in the database where the database is case-sensitive. For example, PostgreSQL is case-sensitive so it doesn't find the field where "ORDERID" is in topic but "orderid" in the database.

    • Example #4: A topic has a $X{ IN, promotion.promotion_district_id, districtID} parameter reference in the SQL to handle a multi-select parameters. JR turns the $X

    into "promotion.promotion_district_id in ('111','112')". If the field is integer and the IN values are strings, PostgreSQL sees this as incorrect SQL.


    Troubleshooting

    In order to assist in troubleshooting, you may want to capture the query that is being generated when the error occurs. Add the following to your WEB-INFclasseslog4j.properties file, restart the server, generate the error again, and then review your WEB-INFlogsjasperserver.log file:

    log4j.logger.com.jaspersoft.commons.semantic.datasource.impl.SemanticLayerSecurityResolverImpl=debug
    log4j.logger.com.jaspersoft.commons.util.JSControlledJdbcQueryExecuter=DEBUG,stdout, fileout log4j.logger.net.sf.jasperreports.engine.query.JRJdbcQueryExecuter=DEBUG,stdout, fileout log4j.logger.com.jaspersoft.ji.adhoc=debug
    log4j.logger.com.jaspersoft.commons.datarator=debug

    Resolutions

    • Resolution #1: If you are running v3.7.0 or v3.7.0.1, it is recommended that you upgrade to the v3.7.1 release as there may be items in this maintenance release that will make your environment more stable.

    • Resolution #2: Ensure that In-Memory Filtering is turned off in your implementation of JasperServer by validating that the following lines in your webappsjasperserver-proWEB-INFapplicationContext-adhoc.xml are set to false:

      <property name="applyQueryFilterInMemory" value="false"/>
      <property name="applySecurityFilterInMemory" value="false"/>
      <property name="applyDynamicFilterInMemory" value="false"/>
    • Resolution #3: Ensure that any join types you have defined in your domain is supported by your DBMS.

    • Resolution #4: As a workaround to Example #2 in the causes above, make sure that specific tables get brought into the query by adding a filterExpression (in the security file) which refers to the table. (See the other notes below for additional information)


    Other Notes

     


    User Feedback

    Recommended Comments

    We are having the same issue when I have calculated fields in domains. I just have used MonthName(<a date field>) to get the month name from the transaction date. Domain is created successfully but when I try to create ad-hoc view using this domain, I get error "Exception getting dataset from cache". A more strange part of this issue is it worked for me couple of times but again generates this same error when I edit the ad-hoc view or create a new ad-hoc view.

    I am using latest JS version,. i.e. JS 7. I also tried it in JS 6 where it allowed me to open the ad-hoc report edit page but when I try to use the month name (coming from calculated field Month_of_Year) by dragging and dropping it to the row section for the chart, it generates error "An error occured while performing the previous request.".

    I also tried to see if ihis was a data volume, but the issue was stll the same even with around 1000 records.

    This issue is really weird. If it doesn't work, JS is kinda useless product.

    Link to comment
    Share on other sites

    Hi Im getting same issue, Can anyone help me on this.

    net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: org.apache.http.client.HttpResponseException: java.lang.RuntimeException: exception getting dataset from cache
        at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:548)
        at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$20(ReportControler.java:523)
        at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:404)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    Caused by: net.sf.jasperreports.engine.JRException: org.apache.http.client.HttpResponseException: java.lang.RuntimeException: exception getting dataset from cache
        at com.jaspersoft.studio.server.domain.conn.DomainQueryExecuter.createDatasource(DomainQueryExecuter.java:164)
        at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1245)
        at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:723)
        at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:440)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:554)
        at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123)
        at java.lang.Thread.run(Thread.java:748)
    Caused by: org.apache.http.client.HttpResponseException: java.lang.RuntimeException: exception getting dataset from cache
        at com.jaspersoft.studio.server.protocol.restv2.RESTv2ExceptionHandler.handleErrorDescriptor(RESTv2ExceptionHandler.java:120)
        at com.jaspersoft.studio.server.protocol.restv2.RESTv2ExceptionHandler.handleException(RESTv2ExceptionHandler.java:60)
        at com.jaspersoft.studio.server.protocol.restv2.ARestV2ConnectionJersey.toObj(ARestV2ConnectionJersey.java:49)
        at com.jaspersoft.studio.server.domain.protocol.RestV2.executeQuery(RestV2.java:143)
        at com.jaspersoft.studio.server.domain.protocol.DomainProxy.executeQuery(DomainProxy.java:45)
        at com.jaspersoft.studio.server.domain.DomainManager.executeQuery(DomainManager.java:95)
        at com.jaspersoft.studio.server.domain.conn.DomainQueryExecuter.createDatasource(DomainQueryExecuter.java:161)
        ... 6 more
    Im facing this issue in Studio 6.4.12

    Thanks

    Ram

    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...