kitodo / kitodo-production

Kitodo.Production is a workflow management tool for mass digitization and is part of the Kitodo Digital Library Suite.
http://www.kitodo.org/software/kitodoproduction/
GNU General Public License v3.0
64 stars 63 forks source link

Unhandled exception on assigning existing workflows to processes #4371

Open henning-gerhardt opened 3 years ago

henning-gerhardt commented 3 years ago

If you assign processes of a project to an existing workflow you encounter this following unhandled exception in your browser window and / or at least in your catalina.out:

30-Apr-2021 13:02:03.852 SEVERE [http-nio-127.0.0.1-8080-exec-13] org.omnifaces.exceptionhandler.FullAjaxExceptionHandler.logException FullAjaxExceptionHandler: An exception occurred during processing JSF ajax request. Error page '/pages/error.jsf' will be shown.
        java.lang.IllegalStateException: Multiple representations of the same entity [org.kitodo.data.database.beans.Process#279412] are being merged. Detached: [FiscAus_511126867 [279412]]; Detached: [FiscAus_511126867 [279412]]
                at org.hibernate.event.internal.EntityCopyNotAllowedObserver.entityCopyDetected(EntityCopyNotAllowedObserver.java:45)
                at org.hibernate.event.internal.MergeContext.put(MergeContext.java:245)
                at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:322)
                at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:172)
                at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:113)
                at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:811)
                at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:784)
                at org.hibernate.engine.spi.CascadingActions$6.cascade(CascadingActions.java:261)
                at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:492)
                at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:416)
                at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:218)
                at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:525)
                at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:456)
                at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:419)
                at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:218)
                at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:151)
                at org.hibernate.event.internal.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:519)
                at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:346)
                at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:172)
                at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:70)
                at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102)
                at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:791)
                at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:778)
                at org.kitodo.data.database.persistence.BaseDAO.storeObject(BaseDAO.java:351)
                at org.kitodo.data.database.persistence.BaseDAO.save(BaseDAO.java:88)
                at org.kitodo.production.services.data.base.SearchDatabaseService.saveToDatabase(SearchDatabaseService.java:64)
                at org.kitodo.production.services.data.base.SearchService.save(SearchService.java:278)
                at org.kitodo.production.services.migration.MigrationService.addProcessesToTemplate(MigrationService.java:198)
                at org.kitodo.production.forms.MigrationForm.useExistingTemplate(MigrationForm.java:390)
                at sun.reflect.GeneratedMethodAccessor1278.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
...

The strange things are

matthias-ronge commented 3 years ago

Note: This is about the migration tool. In everyday operation, there is no way to assign a process to another workflow.

solth commented 3 years ago

@matthias-ronge thanks for the clarification, I was wondering how a new workflow can be assigned to an existing process!