Wednesday, June 20, 2018

could not initialize lazy properties error in Jasper Server

Sometimes after uploading or importing a modified version of a report Jasper server returns an error like this:

could not initialize lazy properties: [com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoFileResource#9370]
org.hibernate.exception.GenericJDBCException : could not initialize lazy properties: [ com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoFileResource #9370] at ...

This is most likely due to caching of internal server references and could be resolved by restarting the server:

$ jasperreports-server-cp-6.1.0/ctlscript.sh restart