Project

General

Profile

bug #9629

Better handling of OptionalDataException

Added by Katja Luther 5 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Highest
Category:
taxeditor
Target version:
Start date:
05/19/2021
Due date:
% Done:

100%

Severity:
normal
Found in Version:

Description

This exception should be handled and the user should be informed to restart the editor.

last remote method : http://api.cybertaxonomy.org:80/euromed/remoting/term.service
last remote request client time : 2021-05-19T11:32:16.744
last remote request response header time : Wed, 19 May 2021 11:32:16 GMT
client error time : 2021-05-19T11:32:16.914
login : e.raabstraube
editor version : 5.22.1
server : api.cybertaxonomy.org (cybertaxonomy.org) / euromed
schema version : 5.22.0.0.20210315
os : Windows 7 6.1 amd64
java : 1.8.0_231
org.eclipse.swt.SWTException: Failed to execute runnable (org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://api.cybertaxonomy.org:80/euromed/remoting/term.service]; nested exception is net.sf.ehcache.CacheException: java.io.OptionalDataException)
                at org.eclipse.swt.SWT.error(SWT.java:4533)
                at org.eclipse.swt.SWT.error(SWT.java:4448)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
                at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
                at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
                at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
                at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
                at eu.etaxonomy.taxeditor.Application.start(Application.java:20)
                at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
                at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://api.cybertaxonomy.org:80/euromed/remoting/term.service]; nested exception is net.sf.ehcache.CacheException: java.io.OptionalDataException
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:226)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:153)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
                at com.sun.proxy.$Proxy45.list(Unknown Source)
                at eu.etaxonomy.taxeditor.store.TermStore.getTermsFromService(TermStore.java:115)
                at eu.etaxonomy.taxeditor.store.TermStore.access$0(TermStore.java:110)
                at eu.etaxonomy.taxeditor.store.TermStore$4.getTerms(TermStore.java:214)
                at eu.etaxonomy.taxeditor.store.TermStore.getTerms(TermStore.java:92)
                at eu.etaxonomy.taxeditor.store.TermStore.getTerms(TermStore.java:52)
                at eu.etaxonomy.taxeditor.store.TermManager.getTerms(TermManager.java:334)
                at eu.etaxonomy.taxeditor.ui.section.description.detail.DistributionDetailElement.getStatusListForArea(DistributionDetailElement.java:128)
                at eu.etaxonomy.taxeditor.ui.section.description.detail.DistributionDetailElement.createControls(DistributionDetailElement.java:92)
                at eu.etaxonomy.taxeditor.ui.section.description.detail.DistributionDetailElement.createControls(DistributionDetailElement.java:1)
                at eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement.updateContent(AbstractCdmDetailElement.java:106)
                at eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement.setEntity(AbstractCdmDetailElement.java:93)
                at eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement.<init>(AbstractDetailedDescriptionDetailElement.java:51)
                at eu.etaxonomy.taxeditor.ui.section.description.detail.DistributionDetailElement.<init>(DistributionDetailElement.java:63)
                at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.createDetailedDescriptionDetailElement(CdmFormFactory.java:3404)
                at eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailElement.createControls(DescriptionElementDetailElement.java:42)
                at eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailElement.createControls(DescriptionElementDetailElement.java:1)
                at eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement.updateContent(AbstractCdmDetailElement.java:106)
                at eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement.setEntity(AbstractCdmDetailElement.java:93)
                at eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection.setEntity(AbstractCdmDetailSection.java:155)
                at eu.etaxonomy.taxeditor.view.detail.CdmSectionPart.setFormInput(CdmSectionPart.java:158)
                at org.eclipse.ui.forms.ManagedForm.setInput(ManagedForm.java:210)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.refresh(AbstractCdmDataViewerE4.java:158)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.setInput(AbstractCdmDataViewerE4.java:141)
                at eu.etaxonomy.taxeditor.view.e4.details.DetailsViewerE4.setInput(DetailsViewerE4.java:206)
                at eu.etaxonomy.taxeditor.view.e4.details.DetailsViewerE4.setInput(DetailsViewerE4.java:177)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4.showViewer(AbstractCdmEditorPartE4.java:283)
                at eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4.selectionChanged_internal(DetailsPartE4.java:107)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4$DelaySelection.run(AbstractCdmEditorPartE4.java:94)
                at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
                ... 23 more
Caused by: net.sf.ehcache.CacheException: java.io.OptionalDataException
                at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:891)
                at net.sf.ehcache.store.disk.Segment.decodeHit(Segment.java:182)
                at net.sf.ehcache.store.disk.Segment.get(Segment.java:225)
                at net.sf.ehcache.store.disk.DiskStore.fault(DiskStore.java:210)
                at net.sf.ehcache.store.CacheStore$4.call(CacheStore.java:198)
                at net.sf.ehcache.store.CacheStore$4.call(CacheStore.java:192)
                at net.sf.ehcache.store.cachingtier.OnHeapCachingTier$Fault.get(OnHeapCachingTier.java:335)
                at net.sf.ehcache.store.cachingtier.OnHeapCachingTier$Fault.access$200(OnHeapCachingTier.java:312)
                at net.sf.ehcache.store.cachingtier.OnHeapCachingTier.get(OnHeapCachingTier.java:176)
                at net.sf.ehcache.store.CacheStore.get(CacheStore.java:192)
                at net.sf.ehcache.Cache.get(Cache.java:1749)
                at net.sf.ehcache.Cache.get(Cache.java:1722)
                at eu.etaxonomy.cdm.api.cache.CdmCacherBase.getCacheElement(CdmCacherBase.java:105)
                at eu.etaxonomy.cdm.api.cache.CdmCacherBase.getFromCache(CdmCacherBase.java:140)
                at eu.etaxonomy.cdm.api.cache.CdmServiceCacher.load(CdmServiceCacher.java:155)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.putToCache(CdmTransientEntityCacher.java:227)
                at eu.etaxonomy.cdm.cache.CacheLoader.putToCache(CacheLoader.java:294)
                at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:321)
                at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursiveAny(CacheLoader.java:83)
                at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursiveCollection(CacheLoader.java:190)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:157)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:66)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.load(CdmTransientEntityCacher.java:165)
                at eu.etaxonomy.taxeditor.session.CdmEntitySession.load(CdmEntitySession.java:65)
                at eu.etaxonomy.taxeditor.session.CdmEntitySessionManager.load(CdmEntitySessionManager.java:119)
                at org.springframework.remoting.httpinvoker.CachingHttpInvokerProxyFactoryBean.handleGeneralRequest(CachingHttpInvokerProxyFactoryBean.java:105)
                at org.springframework.remoting.httpinvoker.CachingHttpInvokerProxyFactoryBean.executeRequest(CachingHttpInvokerProxyFactoryBean.java:81)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:150)
                ... 56 more
Caused by: java.io.OptionalDataException
                at java.io.ObjectInputStream.readObject0(Unknown Source)
                at java.io.ObjectInputStream.readObject(Unknown Source)
                at java.util.HashSet.readObject(Unknown Source)
                at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
                at java.io.ObjectInputStream.readSerialData(Unknown Source)
                at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                at java.io.ObjectInputStream.readObject0(Unknown Source)
                at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
                at java.io.ObjectInputStream.readSerialData(Unknown Source)
                at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                at java.io.ObjectInputStream.readObject0(Unknown Source)
                at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
                at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
                at net.sf.ehcache.Element.readObject(Element.java:885)
                at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
                at java.io.ObjectInputStream.readSerialData(Unknown Source)
                at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                at java.io.ObjectInputStream.readObject0(Unknown Source)
                at java.io.ObjectInputStream.readObject(Unknown Source)
                at net.sf.ehcache.store.disk.DiskStorageFactory.read(DiskStorageFactory.java:371)
                at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:887)
                ... 83 more


Related issues

Related to Edit - bug #9358: OptionalDataException during HTTP invoker call New 12/18/2020

Associated revisions

Revision ab79a3ac (diff)
Added by Katja Luther 5 months ago

ref #9629: handle OptionalDataException

Revision bac6e6b4 (diff)
Added by Katja Luther 5 months ago

ref #9629: handle OptionalDataException - continue

Revision f2b0935d (diff)
Added by Andreas Müller 5 months ago

ref #9629 adapting message string

Revision c7198d48 (diff)
Added by Katja Luther 4 months ago

ref #9629: iterate over causes of exception

Revision 9536f3f2 (diff)
Added by Andreas Müller 3 months ago

ref #9629 cleanup t != null check and OptionalDataException check.

Revision c5a4c165 (diff)
Added by Andreas Müller 3 months ago

fix #9629 handle OptionalDataException earlier in stack and recursive getCause()

History

#1 Updated by Andreas Müller 5 months ago

  • Target version changed from Unassigned CDM tickets to Release 5.25

I guess this is fast to implement as we only need to search for "java.io.OptionalDataException" in the stacktrace.
Also it happens relatively often so it is worth implementing it soon to avoid user requests on this.

#2 Updated by Andreas Müller 5 months ago

  • Related to bug #9358: OptionalDataException during HTTP invoker call added

#3 Updated by Andreas Müller 5 months ago

The general problem was reported in #9358 already.

#4 Updated by Katja Luther 5 months ago

  • Status changed from New to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

the exception is hanlded now, please review.

#5 Updated by Andreas Müller 5 months ago

  • Status changed from Resolved to Closed

This is difficult to review as I can't create the exception that shows if it works or not. However, the code looks ok and I suggest to close the ticket and reopen if it does not work.

#6 Updated by Andreas Müller 5 months ago

  • % Done changed from 0 to 100

#7 Updated by Andreas Müller 5 months ago

  • Target version changed from Release 5.25 to Release 5.24

#8 Updated by Andreas Müller 4 months ago

  • Status changed from Closed to Feedback
  • Assignee changed from Andreas Müller to Katja Luther
  • Target version changed from Release 5.24 to Release 5.25
  • % Done changed from 100 to 10

Reopen this ticket. Using toString is incorrect method to check if an exception is in the stacktrace.

exception.toString returns something like "[Ljava.lang.StackTraceElement;@15db9742"

There should be other example in the code for correct error extraction.

#9 Updated by Andreas Müller 4 months ago

For testing you could manually throw an OptionalDataException and try to catch it correctly.

#10 Updated by Andreas Müller 4 months ago

You could e.g. recursively iterate through exception e and its causes e.getCause() and check all these exceptions for getClass().getName()

#11 Updated by Katja Luther 3 months ago

  • Status changed from Feedback to In Progress
  • Target version changed from Release 5.25 to Release 5.28

#12 Updated by Andreas Müller 3 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 10 to 50

#13 Updated by Andreas Müller 3 months ago

  • Priority changed from New to Highest
  • Target version changed from Release 5.28 to Release 5.25

This should be fixed. I tested by adding the following code to the beginning of BulkEditorUtil.openBulkEditor()

   try{
        Constructor<OptionalDataException> c = OptionalDataException.class.getDeclaredConstructor(int.class);
        c.setAccessible(true);
        OptionalDataException a = c.newInstance(0);
        if (true) {
            throw a;
        }
    }catch(Exception e){
        try {
            throw new RuntimeException(e);
        } catch (Exception e1) {
            throw new RuntimeException(e1);
        }
    }

and then opening the author bulk editor.

Please review and maybe adapt error handling if needed.

#14 Updated by Katja Luther 3 months ago

  • Status changed from Resolved to Closed
  • Assignee changed from Katja Luther to Andreas Müller
  • % Done changed from 50 to 100

works as expected.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)