Project

General

Profile

bug #7946

RegistrationStatusFieldInstantiator must set status value internally before adding the ValueChangedListener

Added by Andreas Kohlbecker about 1 month ago. Updated about 1 month ago.

Status:
Closed
Priority:
Highest
Category:
cdm-vaadin
Target version:
Start date:
12/11/2018
Due date:
% Done:

100%

Severity:
normal
Found in Version:
Tags:

Description

Henning reported the following problem:

Beim Testen von: https://dev.e-taxonomy.eu/redmine/issues/7899

Hängt das mit unerlaubten Einträgen zusammen oder war der Server gerade beim Rebuilt?

http://test.e-taxonomy.eu/cdmserver/phycobank/app/registration#!workingset/9d80da69-2098-42a7-8cb8-be4fff0ecc59

eu.etaxonomy.vaadin.mvp.PopupEditorException: Error saving popup editor -  context [user=w.h.kusber] :Edit registration (TypedEntityReference: Registration#null) > New taxon name (TaxonNameDTO: TaxonName#0<292a97c0-b498-4e10-9e3e-1b4306226d1b>)
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor.save(AbstractPopupEditor.java:448)
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor.lambda$new$fad408e6$1(AbstractPopupEditor.java:174)
               at sun.reflect.GeneratedMethodAccessor1632.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
               at java.lang.reflect.Method.invoke(Method.java:498)
               at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
               at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:200)
               at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:163)
               at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1015)
               at com.vaadin.ui.Button.fireClick(Button.java:377)
               at com.vaadin.ui.Button$1.click(Button.java:54)
               at sun.reflect.GeneratedMethodAccessor1727.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
               at java.lang.reflect.Method.invoke(Method.java:498)
               at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:158)
               at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:119)
               at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:437)
               at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:402)
               at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:273)
               at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
               at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
               at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1435)
               at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:380)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
               at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
               at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
               at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
               at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
               at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
               at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
               at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
               at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
               at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
               at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
               at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
               at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
               at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
               at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
               at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
               at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
               at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
               at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
               at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
               at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
               at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
               at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
               at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
               at org.eclipse.jetty.server.Server.handle(Server.java:497)
               at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
               at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
               at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
               at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
               at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
               at java.lang.Thread.run(Thread.java:748)
Caused by: com.vaadin.data.fieldgroup.FieldGroup$CommitException: Commit failed
               at com.vaadin.data.fieldgroup.FieldGroup.commit(FieldGroup.java:509)
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor.save(AbstractPopupEditor.java:428)
               ... 80 more
Caused by: com.vaadin.data.fieldgroup.FieldGroup$CommitException: Failed to store data to backend
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor$SaveHandler.postCommit(AbstractPopupEditor.java:374)
               at com.vaadin.data.fieldgroup.FieldGroup.firePostCommitEvent(FieldGroup.java:625)
               at com.vaadin.data.fieldgroup.FieldGroup.commit(FieldGroup.java:501)
               ... 81 more
Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method valueChange in eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter$1$$Lambda$57/1841381974 failed.
               at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:533)
               at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:200)
               at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:163)
               at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1015)
               at com.vaadin.ui.AbstractField.fireValueChange(AbstractField.java:1161)
               at com.vaadin.ui.AbstractField.setValue(AbstractField.java:571)
               at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:735)
               at com.vaadin.ui.AbstractField.setValue(AbstractField.java:468)
               at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:698)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorksetViewBean.putRegistrationListComponent(RegistrationWorksetViewBean.java:441)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorksetViewBean.createRegistrationsList(RegistrationWorksetViewBean.java:239)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorksetViewBean.setWorkingset(RegistrationWorksetViewBean.java:183)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter.applyWorkingset(RegistrationWorkingsetPresenter.java:266)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter.refreshView(RegistrationWorkingsetPresenter.java:215)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter.onDoneWithTaxonnameEditor(RegistrationWorkingsetPresenter.java:513)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
               at java.lang.reflect.Method.invoke(Method.java:498)
               at org.vaadin.spring.events.internal.MethodListenerWrapper.publish(MethodListenerWrapper.java:78)
               at org.vaadin.spring.events.internal.ListenerCollection.publish(ListenerCollection.java:167)
               at org.vaadin.spring.events.internal.ScopedEventBus$1.onEvent(ScopedEventBus.java:58)
               at org.vaadin.spring.events.internal.EventBusListenerWrapper.publish(EventBusListenerWrapper.java:55)
               at org.vaadin.spring.events.internal.ListenerCollection.publish(ListenerCollection.java:167)
               at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:116)
               at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:131)
               at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:133)
               at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:121)
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor$SaveHandler.postCommit(AbstractPopupEditor.java:371)
               ... 83 more
Caused by: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eu.etaxonomy.cdm.model.name.TaxonName.status
               at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:99)
               at org.hibernate.engine.internal.Collections.processUnreachableCollection(Collections.java:50)
               at org.hibernate.event.internal.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:243)
               at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:86)
               at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:44)
               at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1251)
               at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1767)
               at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
               at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.findByUuid(CdmEntityDaoBase.java:423)
               at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.findByUuid(CdmEntityDaoBase.java:410)
               at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.findByUuid(VersionableDaoBase.java:67)
               at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.findByUuid(VersionableDaoBase.java:36)
               at eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase.load(CdmEntityDaoBase.java:741)
               at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.load(VersionableDaoBase.java:93)
               at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.load(VersionableDaoBase.java:36)
               at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:184)
               at eu.etaxonomy.cdm.api.service.ServiceBase.load(ServiceBase.java:42)
               at sun.reflect.GeneratedMethodAccessor1638.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
               at java.lang.reflect.Method.invoke(Method.java:498)
               at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
               at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
               at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
               at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
               at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
               at com.sun.proxy.$Proxy737.load(Unknown Source)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter.saveRegistrationStatusChange(RegistrationWorkingsetPresenter.java:353)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter.access$000(RegistrationWorkingsetPresenter.java:112)
               at eu.etaxonomy.cdm.vaadin.view.registration.RegistrationWorkingsetPresenter$1.lambda$create$dcf1e106$1(RegistrationWorkingsetPresenter.java:252)
               at sun.reflect.GeneratedMethodAccessor1587.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
               at java.lang.reflect.Method.invoke(Method.java:498)
               at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
               ... 111 more

This was caused by the RegistrationStatusFieldInstantiator which adds the valueChangeListener, the status value however ist set afterwards in the View.

Setting the value directly in the instantiator should avoid such problems.

Associated revisions

Revision c4f3380a (diff)
Added by Andreas Kohlbecker about 1 month ago

fix #7946 setting the status value directly in the RegistrationStatusFieldInstantiator

History

#1 Updated by Andreas Kohlbecker about 1 month ago

  • Tags set to phycobank

#2 Updated by Andreas Kohlbecker about 1 month ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#3 Updated by Andreas Kohlbecker about 1 month ago

  • Status changed from Resolved to Closed
  • % Done changed from 50 to 100

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)