Error upon saving report - ERROR: update or delete on table "jifileresource" violates foreign key constraint "fk98818b778c8df21b" on table "jireportunit"

0

I copied a report unit to another folder renaming it and using copies of the resources such as sub report etc. But upon trying to save the report in Jasper studio, I am getting the below error. What am I missing?

Stack Trace

org.apache.http.client.HttpResponseException: resource.in.use could not delete: [com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoFileResource#2073]: ERROR: update or delete on table "jifileresource" violates foreign key constraint "fk98818b778c8df21b" on table "jireportunit" Detail: Key (id)=(2073) is still referenced from table "jireportunit". at com.jaspersoft.studio.server.protocol.restv2.RESTv2ExceptionHandler.handleErrorDescriptor(RESTv2ExceptionHandler.java:122) at com.jaspersoft.studio.server.protocol.restv2.RESTv2ExceptionHandler.handleException(RESTv2ExceptionHandler.java:78) at com.jaspersoft.studio.server.protocol.restv2.ARestV2ConnectionJersey.toObj(ARestV2ConnectionJersey.java:57) at com.jaspersoft.studio.server.protocol.restv2.RestV2ConnectionJersey.addOrModifyResource(RestV2ConnectionJersey.java:557) at com.jaspersoft.studio.server.protocol.ProxyConnection.addOrModifyResource(ProxyConnection.java:336) at com.jaspersoft.studio.server.WSClientHelper.saveResource(WSClientHelper.java:323) at com.jaspersoft.studio.server.WSClientHelper.save(WSClientHelper.java:368) at com.jaspersoft.studio.server.publish.Publish.saveResource(Publish.java:286) at com.jaspersoft.studio.server.publish.Publish.publishResources(Publish.java:199) at com.jaspersoft.studio.server.publish.Publish.publish(Publish.java:69) at com.jaspersoft.studio.server.publish.wizard.Publish2ServerWizard$3.run(Publish2ServerWizard.java:311) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

vishnu.karanathmana's picture
Joined: Jan 13 2016 - 5:32am
Last seen: 3 years 1 month ago

1 Answer:

0

If you have access to the postgres database running behind the jasper server, this issue can be cleared up i believe.

The jasper repository database has a table called as jireportunit

from which you should be able to query the reportunit and delete the dependency.

It might have been caused by copying the report unit multiple times and changing its attributes.

reportdev's picture
1242
Joined: Oct 12 2015 - 12:05pm
Last seen: 2 weeks 11 hours ago
Feedback
randomness