Project

General

Profile

bug #7386

TaxonNamePopEditor: com.vaadin.data.Property$ReadOnlyException on saving a basionym

Added by Andreas Kohlbecker 8 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
New
Category:
cdm-vaadin
Target version:
Start date:
04/27/2018
Due date:
% Done:

50%

Severity:
normal
Found in Version:
Tags:

Description

Eingabe Basionym (für Alpha gggg), Fehler nach eingabe der Basionymreferenz mit Basionymauthorteam auf der Screenshot-Seite:
http://test.e-taxonomy.eu/cdmserver/phycobank/app/registration#!workingset/f0500a66-49a6-46a3-95e2-eca92f9c625d

Caused by: java.lang.reflect.InvocationTargetException
               at sun.reflect.GeneratedMethodAccessor2135.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)
               ... 66 more
Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method buttonClick in eu.etaxonomy.vaadin.mvp.AbstractPopupEditor$$Lambda$133/1533192852 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.Button.fireClick(Button.java:377)
               at com.vaadin.ui.Button$1.click(Button.java:54)
               ... 70 more
Caused by: java.lang.RuntimeException: Error saving
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor.save(AbstractPopupEditor.java:318)
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor.lambda$new$fad408e6$1(AbstractPopupEditor.java:132)
               at sun.reflect.GeneratedMethodAccessor2136.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)
               ... 75 more
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:305)
               ... 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:273)
               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.data.Property$ReadOnlyException
               at com.vaadin.ui.AbstractField.setValue(AbstractField.java:493)
               at com.vaadin.ui.AbstractField.setValue(AbstractField.java:468)
               at com.vaadin.ui.AbstractField.setValue(AbstractField.java:453)
               at org.vaadin.viritin.fields.TypedSelect.setValue(TypedSelect.java:503)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNameEditorPresenter.onEntityChangeEvent(TaxonNameEditorPresenter.java:352)
               at sun.reflect.GeneratedMethodAccessor2252.invoke(Unknown Source)
               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.publish(ScopedEventBus.java:116)
               at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:109)
               at eu.etaxonomy.vaadin.mvp.AbstractCdmEditorPresenter.onEditorSaveEvent(AbstractCdmEditorPresenter.java:163)
               at sun.reflect.GeneratedMethodAccessor2175.invoke(Unknown Source)
               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.publish(ScopedEventBus.java:116)
               at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:109)
               at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor$SaveHandler.postCommit(AbstractPopupEditor.java:265)
               ... 83 more

Alpha gggg und Alpha hhhh wurden dann gar nicht gespeichert.

Bei Basionym geht die Auswahl nicht.

Auch ein Basionym mit ausgewählter Reference wird nicht angenommen.

picture361-1.png View (35.1 KB) Andreas Kohlbecker, 04/27/2018 03:25 PM

cretated-basionym.png View (26.1 KB) Andreas Kohlbecker, 04/27/2018 04:12 PM

new_reference.png View (37.7 KB) Andreas Kohlbecker, 04/27/2018 04:12 PM

add-new-basionym.png View (25.9 KB) Andreas Kohlbecker, 04/27/2018 04:12 PM

open-name.png View (31.8 KB) Andreas Kohlbecker, 04/27/2018 04:12 PM


Related issues

Related to Edit - bug #7387: TaxonNamePopEditor: ConstraintViolationException on saving a basionym Closed 04/27/2018
Related to Edit - bug #7389: NameTypeDesignationEditor typifiedNamesComboboxSelect always is readonly New 04/28/2018
Related to Edit - bug #7557: TaxonNamePopEditor: com.vaadin.data.Property$ReadOnlyException on saving a sub popup editor Closed 07/17/2018
Duplicated by Edit - bug #6707: transient properties managed by ToManyRelatedEntitiesListSelect are not updated on save Duplicate 06/08/2017

Associated revisions

Revision 7a72a0fe (diff)
Added by Andreas Kohlbecker 8 months ago

ref #7386 reducing redundancy in name relationship handling methods, adding methods for general use

Revision d914aab4 (diff)
Added by Andreas Kohlbecker 8 months ago

fix #7386 adding missing setBasionyms() method to taxonNameDTO

Revision 18f20e1c (diff)
Added by Andreas Kohlbecker 8 months ago

ref #7386 adding missing setBasionyms() method to taxonNameDTO - 2

Revision 434cbfa8 (diff)
Added by Andreas Kohlbecker 8 months ago

ref #7386 adding missing setBasionyms() method to taxonNameDTO - 3

Revision fefbc963 (diff)
Added by Andreas Kohlbecker 8 months ago

ref #7386 removing obsolete handleTransientProperties() method

Revision 4d297f89 (diff)
Added by Andreas Kohlbecker 8 months ago

ref #7386 fixing NPE

History

#1 Updated by Andreas Kohlbecker 8 months ago

Ich kann das leider nicht reproduzieren

#2 Updated by Andreas Kohlbecker 8 months ago

Sollte dieser Fehler bis Juni 2018 nicht wieder auftauchen ist er eventuell schon beseitigt worden und wir sollten das Ticket schließen.

#3 Updated by Andreas Kohlbecker 8 months ago

I could reproduce this issue while trying to reproduce the issue #7387.

The Steps I took where:

  1. Open existing name which has no basionym

  1. enable basionym section and click new button to open second TaxonNameEditor to create the basionym

  1. Create a new reference for the basionym

  1. Save the reference, this closes the reference editor and reveals the editor for the basionym:

  1. Save the basionym.

TaxonNameEditor basionym ToManyRelatedEntitiesComboboxSelect is readonly and the LazySelect childcomponent of the ToManyRelatedEntitiesComboboxSelect is also readonly, This causes the below code snipped to fail:


getCache().load(event.getEntity());
if(event.isCreatedType()){
    basionymSourceField.setValue((TaxonName) event.getEntity()); // ##### com.vaadin.data.Property$ReadOnlyException
} else {
    ((ReloadableSelect)basionymSourceField).reload();
}
Caused by: com.vaadin.data.Property$ReadOnlyException
    at com.vaadin.ui.AbstractField.setValue(AbstractField.java:493)
    at com.vaadin.ui.AbstractField.setValue(AbstractField.java:468)
    at com.vaadin.ui.AbstractField.setValue(AbstractField.java:453)
    at org.vaadin.viritin.fields.TypedSelect.setValue(TypedSelect.java:503)
    at eu.etaxonomy.cdm.vaadin.view.name.TaxonNameEditorPresenter.onEntityChangeEvent(TaxonNameEditorPresenter.java:355)
    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.publish(ScopedEventBus.java:116)
    at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:109)
    at eu.etaxonomy.vaadin.mvp.CdmEditorPresenterBase.onEditorSaveEvent(CdmEditorPresenterBase.java:205)
    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.publish(ScopedEventBus.java:116)
    at org.vaadin.spring.events.internal.ScopedEventBus.publish(ScopedEventBus.java:109)
    at eu.etaxonomy.vaadin.mvp.AbstractPopupEditor$SaveHandler.postCommit(AbstractPopupEditor.java:339)
    ... 89 more

#4 Updated by Andreas Kohlbecker 8 months ago

The problem is caused by the TaxonNameDTO having the getter getBasionyms() but not having the according set method. The vaadin fieldFieldGroup.configureField(Field<?> field) method thus sets the field to readonly. So any attempt to set the value will cause a readonly exception.

There are two options now:

  1. set the field to readonly == false before doing the setValue()
  2. add the missing setter method to the TaxonNameDTO

#5 Updated by Andreas Kohlbecker 8 months ago

  • Related to bug #7387: TaxonNamePopEditor: ConstraintViolationException on saving a basionym added

#6 Updated by Andreas Kohlbecker 8 months ago

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

#7 Updated by Andreas Kohlbecker 8 months ago

  • Related to bug #7389: NameTypeDesignationEditor typifiedNamesComboboxSelect always is readonly added

#8 Updated by Andreas Kohlbecker 8 months ago

  • Assignee changed from Andreas Kohlbecker to Wolf-Henning Kusber

I no longer can reproduce this issue. Henning, can you? Please review.

#9 Updated by Andreas Kohlbecker 8 months ago

  • Duplicated by bug #6707: transient properties managed by ToManyRelatedEntitiesListSelect are not updated on save added

#10 Updated by Andreas Kohlbecker 6 months ago

Henning wrote:

http://test.e-taxonomy.eu/cdmserver/phycobank/app/registration#!workingset/bd075280-f7ff-401b-8353-6621c41354f9

Als curator einen Namen mit Referenz eingegeben (Synedra paludosa)
Als submitter1 eine neue Referenz mit neuem Namen eingegeben (Fragilaria paludosa),
als Basionym Synedra paludosa ausgewählt, Speichern führt zum Fehler:

Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method valueChange in eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor$$Lambda$125/34314791 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 eu.etaxonomy.vaadin.component.ToManyRelatedEntitiesListSelect.lambda$addNewRow$558de902$1(ToManyRelatedEntitiesListSelect.java:310)
               at sun.reflect.GeneratedMethodAccessor2148.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)
               ... 88 more
Caused by: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
               at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:148)
               at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:266)
               at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:68)
               at eu.etaxonomy.cdm.model.reference.Reference_$$_jvst7d8_25.getAuthorship(Reference_$$_jvst7d8_25.java)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.inferBasiomynAuthors(TaxonNamePopupEditor.java:359)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.updateAuthorshipFields(TaxonNamePopupEditor.java:442)
               at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.lambda$updateAuthorshipFieldData$c3f3f4e5$1(TaxonNamePopupEditor.java:513)
               at sun.reflect.GeneratedMethodAccessor2148.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)
               ... 97 more

VG
Henning

#11 Updated by Andreas Kohlbecker 6 months ago

I tried once again to reproduce this without success. Can you still reproduce the error?

#12 Updated by Andreas Kohlbecker 5 months ago

  • Related to bug #7557: TaxonNamePopEditor: com.vaadin.data.Property$ReadOnlyException on saving a sub popup editor added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)