Deletion of VirtualCollection fails
Currently deleting a VirtualCollection? fails with the following exception:
2016-04-07 13:41:55,702 ERROR [ttp-nio-8080-exec-57 eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryImpl#getVirtualCollectionCount:554] - error while counting virtual collections
java.lang.IllegalStateException: Transaction already active
eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryPermissionException: virtual collection cannot be deleted
at eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryImpl.deleteVirtualCollection(VirtualCollectionRegistryImpl.java:244)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:57)
at eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryImpl.getVirtualCollectionCount(VirtualCollectionRegistryImpl.java:543)
at eu.clarin.cmdi.virtualcollectionregistry.gui.table.CollectionsProvider.size(CollectionsProvider.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at org.apache.wicket.markup.repeater.data.DataViewBase.internalGetItemCount(DataViewBase.java:141)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.apache.wicket.markup.repeater.AbstractPageableView.getItemCount(AbstractPageableView.java:258)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.wicket.markup.repeater.AbstractPageableView.getRowCount(AbstractPageableView.java:240)
at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:414)
at org.apache.wicket.markup.repeater.AbstractPageableView.getViewSize(AbstractPageableView.java:352)
at org.apache.wicket.markup.repeater.AbstractPageableView.getItemModels(AbstractPageableView.java:105)
at org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:94)
at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:131)
at org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:121)
at org.apache.wicket.proxy.$Proxy412.deleteVirtualCollection(Unknown Source)
at eu.clarin.cmdi.virtualcollectionregistry.gui.pages.BrowseEditableCollectionsPanel$DeleteCollectionDialog.onConfirm(BrowseEditableCollectionsPanel.java:310)
at eu.clarin.cmdi.virtualcollectionregistry.gui.dialog.ConfirmationDialog$1.onClose(ConfirmationDialog.java:64)
at org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.respondOnWindowClosed(ModalWindow.java:989)
at org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow$WindowClosedBehavior.respond(ModalWindow.java:1005)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:312)
at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:157)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at eu.clarin.cmdi.virtualcollectionregistry.gui.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at eu.clarin.cmdi.virtualcollectionregistry.rest.PersistenceFilter.doFilter(PersistenceFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at org.apache.wicket.Component.prepareForRender(Component.java:2297)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at org.apache.wicket.Component.prepareForRender(Component.java:2329)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:680)
at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:590)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at java.lang.Thread.run(Thread.java:745)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1287)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at eu.clarin.cmdi.virtualcollectionregistry.gui.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at eu.clarin.cmdi.virtualcollectionregistry.rest.PersistenceFilter.doFilter(PersistenceFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
2016-04-07 13:41:55,718 ERROR [ttp-nio-8080-exec-57 org.apache.wicket.RequestCycle#logRuntimeException:1558] - eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException: error while counting virtual collections
org.apache.wicket.WicketRuntimeException: eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException: error while counting virtual collections
at eu.clarin.cmdi.virtualcollectionregistry.gui.table.CollectionsProvider.size(CollectionsProvider.java:51)
at org.apache.wicket.markup.repeater.data.DataViewBase.internalGetItemCount(DataViewBase.java:141)
at org.apache.wicket.markup.repeater.AbstractPageableView.getItemCount(AbstractPageableView.java:258)
at org.apache.wicket.markup.repeater.AbstractPageableView.getRowCount(AbstractPageableView.java:240)
at org.apache.wicket.markup.repeater.AbstractPageableView.getViewSize(AbstractPageableView.java:352)
at org.apache.wicket.markup.repeater.AbstractPageableView.getItemModels(AbstractPageableView.java:105)
at org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:94)
at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:131)
at org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:121)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
at org.apache.wicket.Component.beforeRender(Component.java:1103)
at org.apache.wicket.Component.prepareForRender(Component.java:2297)
at org.apache.wicket.Component.prepareForRender(Component.java:2329)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:853)
at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:680)
at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:590)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1287)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at eu.clarin.cmdi.virtualcollectionregistry.gui.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at eu.clarin.cmdi.virtualcollectionregistry.rest.PersistenceFilter.doFilter(PersistenceFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException: error while counting virtual collections
at eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryImpl.getVirtualCollectionCount(VirtualCollectionRegistryImpl.java:555)
at eu.clarin.cmdi.virtualcollectionregistry.gui.table.CollectionsProvider.size(CollectionsProvider.java:49)
... 58 more
Caused by: java.lang.IllegalStateException: Transaction already active
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:57)
at eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryImpl.getVirtualCollectionCount(VirtualCollectionRegistryImpl.java:543)
... 59 more
This exception is caused by a transaction in the UI. There seems to be a clash with a transaction in the VirtualCollectionRegistryImpl?.
The issue has been resolved. This behaviour was caused by preventing deletion based on VC state. After allowing deletion of VC objects based with ERROR state:
The stacktrace is a bit misleading.