Error when running query in Jasper Studio

Document ID : KB000102394
Last Modified Date : 18/06/2018
Show Technical Document Details
Issue:
When attempting to run a query in Jaspersoft Studio, an error comes back: "Error preparing statement for executing the report query".   In the jasperserver.log file, the following errors may be noted:

2018-06-13 13:54:21,331 ERROR MetaDataServiceImpl,http-nio-8080-exec-2:89 [PPMSERVER_dev|dev_user] - Connection Error.Cannot get bean datasource connection:java.lang.reflect.InvocationTargetException

2018-06-13 13:54:21,331 ERROR MetaDataServiceImpl,http-nio-8080-exec-2:89 [PPMSERVER_dev|dev_user] - Connection Error.Cannot get bean datasource connection:java.lang.reflect.InvocationTargetException


 
Cause:
This problem may be caused by the parameters on the jasperadmin user in Jaspersoft being out of sync with PPM.  
Resolution:
To correct this problem, follow these steps to remove all attributes for the japseradmin user in Jaspersoft Server:
1. Login to customer PPM and navigate to advance reporting 
2. GO to Manage > Users 
3. Search for user jasperadmin and edit the user 
4. Go to the Attributes tab 
5. Delete all the attributes 

Then once confirmed that all attributes are removed from that user, run the following command:
admin update jasperParameters 

This will resync the proper attributes for the user in Jaspersoft Server, and should resolve the issue.