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
Recommended Comments
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 accountSign in
Already have an account? Sign in here.
Sign In Now