Project

General

Profile

Actions

bug #7699

open

NPE in CdmTransientEntityCacher.getCacheElement()

Added by Katja Luther over 4 years ago. Updated 2 months ago.

Status:
In Progress
Priority:
Highest
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

10%

Estimated time:
Severity:
major
Found in Version:

Description

NPE when searching for specimen (but probably not only then).

#9174 (duplicate) suggests that it happens when the TaxEditor wasn't used longer time.

#note-21 suggests it explicitly happens for bulk editors when closed during an (asynchronous) specimen search. However, it is unlikely that this is the only reason (if at all) as it happens also in other contexts and as the last sentence in #note-21 mentions it leads to a situation where TaxEditor needs to be restarted or at least reconnected, so it is not only the problem of a single session/bulk editor.

login : 
editor version : 5.3.0.201808280657
server :  ()
schema version : 
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://test.e-taxonomy.eu:80/cdmserver/rem_conf_am/remoting/occurrence.service]; nested exception is java.lang.NullPointerException
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:216)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:147)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
                at com.sun.proxy.$Proxy96.findByTitle(Unknown Source)
                at eu.etaxonomy.taxeditor.store.SearchManager.findOccurrences(SearchManager.java:158)
                at eu.etaxonomy.taxeditor.store.SearchManager.findOccurrences(SearchManager.java:115)
                at eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput.listEntities(OccurrenceEditorInput.java:70)
                at eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput.lambda$0(AbstractBulkEditorInput.java:219)
                at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:186)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getCacheElement(CdmTransientEntityCacher.java:254)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getFromCache(CdmTransientEntityCacher.java:259)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.put(CdmTransientEntityCacher.java:235)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:273)
                at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:298)
                at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:87)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:189)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:160)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:72)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.load(CdmTransientEntityCacher.java:132)
                at eu.etaxonomy.taxeditor.session.CdmEntitySession.load(CdmEntitySession.java:77)
                at eu.etaxonomy.taxeditor.session.CdmEntitySessionManager.load(CdmEntitySessionManager.java:131)
                at eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor.doExecuteRequest(CdmServiceRequestExecutor.java:75)
                at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:138)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:194)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:176)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:144)
                ... 9 more


Related issues

Related to EDIT - bug #10186: Problems with session handling in taxeditorClosedKatja Luther

Actions
Has duplicate EDIT - bug #8626: NullPointerException (NPE) on saving Specimen Editor (list)DuplicateKatja Luther

Actions
Has duplicate EDIT - bug #8923: NullPointerException (NPE) after attempt to save invalid Group name DuplicateKatja Luther

Actions
Has duplicate EDIT - bug #9174: After longer inactivity NPE for cacheDuplicateKatja Luther

Actions
Actions #2

Updated by Patrick Plitzner over 4 years ago

  • Status changed from New to Feedback
  • Assignee changed from Patrick Plitzner to Andreas Müller

I cannot reproduce this. On which DB did you test? Does it always happen for any search on any DB?

Actions #3

Updated by Andreas Müller over 4 years ago

On rem_conf_am (see stacktrace) and search for "A*"

Actions #4

Updated by Andreas Müller over 4 years ago

  • Assignee changed from Andreas Müller to Patrick Plitzner
Actions #5

Updated by Patrick Plitzner over 4 years ago

  • Assignee changed from Patrick Plitzner to Katja Luther

Andreas Müller wrote:

On rem_conf_am (see stacktrace) and search for "A*"

I cannot reproduce this here either

Actions #6

Updated by Andreas Müller over 4 years ago

It still exists sometimes

login : 
editor version : 5.3.0.201809042248
server :  ()
schema version : 
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://test.e-taxonomy.eu:80/cdmserver/rem_conf_am/remoting/reference.service]; nested exception is java.lang.NullPointerException
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:216)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:147)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy58.findByTitle(Unknown Source)
    at eu.etaxonomy.taxeditor.store.SearchManager.findReferences(SearchManager.java:89)
    at eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput.listEntities(ReferenceEditorInput.java:102)
    at eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput.lambda$0(AbstractBulkEditorInput.java:219)
    at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:186)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getCacheElement(CdmTransientEntityCacher.java:254)
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getFromCache(CdmTransientEntityCacher.java:259)
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.put(CdmTransientEntityCacher.java:235)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:268)
    at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:293)
    at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:84)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:184)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:155)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:69)
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.load(CdmTransientEntityCacher.java:131)
    at eu.etaxonomy.taxeditor.session.CdmEntitySession.load(CdmEntitySession.java:70)
    at eu.etaxonomy.taxeditor.session.CdmEntitySessionManager.load(CdmEntitySessionManager.java:131)
    at eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor.doExecuteRequest(CdmServiceRequestExecutor.java:75)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:138)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:194)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:176)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:144)
    ... 8 more

my idea was that it happens if you start search while the views still refresh and tried to reproduce

login : 
editor version : 5.3.0.201809042248
server :  ()
schema version : 
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://test.e-taxonomy.eu:80/cdmserver/rem_conf_am/remoting/reference.service]; nested exception is java.lang.NullPointerException
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:216)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:147)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy58.findByTitle(Unknown Source)
    at eu.etaxonomy.taxeditor.store.SearchManager.findReferences(SearchManager.java:89)
    at eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput.listEntities(ReferenceEditorInput.java:102)
    at eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput.lambda$0(AbstractBulkEditorInput.java:219)
    at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:186)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException

This was reproducable after it happended once, even in other bulk editors. Only restarting the TaxEditor solved the issue. After restart also the first error could not be reproduced. So it seems to happen only in a certain state of the TaxEditor

However, even if difficult to reproduce we should think about handling the NPE case. What if getCache() returns null. Should we create a new cache and merge all existing data into it?

Also we should have a look why the cache can be null. Something wrong with dispose handling in special cases. Maybe a "disposed" flag can help to find the reason. Once the cacher is disposed the flag should be set to true. Calling getCache() on disposed Cacher then throws a specific Exception saying that this is not allowed.

Or do we reuse Cachers after dispose was called?

Actions #7

Updated by Andreas Müller over 4 years ago

Added AK as this is maybe a general ticket about handling of disposed in CdmTransientEntityCacher so might be interesting for him too.

Actions #8

Updated by Katja Luther over 4 years ago

  • Target version changed from Release 5.3 to Release 5.4
Actions #9

Updated by Andreas Kohlbecker over 4 years ago

I also had it today in the Users Bulkeditor:

login : 
editor version : 5.4.0.201810151448
server :  ()
schema version : 
os : Linux 4.15.0-34-generic amd64
java : 1.8.0_131
org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://160.45.63.231:80/cdmserver/phycobank_01/remoting-public/user.service]; nested exception is java.lang.NullPointerException
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:216)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:147)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy25.listByUsername(Unknown Source)
    at eu.etaxonomy.taxeditor.store.SearchManager.findUsers(SearchManager.java:166)
    at eu.etaxonomy.taxeditor.bulkeditor.input.UserEditorInput.listEntities(UserEditorInput.java:79)
    at eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput.lambda$0(AbstractBulkEditorInput.java:273)
    at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:186)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getCacheElement(CdmTransientEntityCacher.java:288)
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getFromCache(CdmTransientEntityCacher.java:293)
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.put(CdmTransientEntityCacher.java:261)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:268)
    at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:293)
    at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:84)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:184)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:155)
    at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:67)
    at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.load(CdmTransientEntityCacher.java:157)
    at eu.etaxonomy.taxeditor.session.CdmEntitySession.load(CdmEntitySession.java:70)
    at eu.etaxonomy.taxeditor.session.CdmEntitySessionManager.load(CdmEntitySessionManager.java:131)
    at eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor.doExecuteRequest(CdmServiceRequestExecutor.java:75)
    at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:138)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:194)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:176)
    at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:144)
    ... 8 more
Actions #10

Updated by Andreas Müller about 4 years ago

  • Target version changed from Release 5.4 to Release 5.5

As this does not seem to be solved yet I move it to the next version.

Actions #11

Updated by Katja Luther almost 4 years ago

the cache is disposed if the cdmEntitySession is closed, for the bulkeditor this is the case when the editor is saved or closed. But I could not reproduce this exception whether for closing nor for saving and searching in parallel

Actions #12

Updated by Katja Luther almost 4 years ago

  • Target version changed from Release 5.5 to Release 5.6
Actions #13

Updated by Andreas Müller almost 4 years ago

  • Target version changed from Release 5.6 to Reviewed Next Major Release
Actions #14

Updated by Andreas Müller over 3 years ago

  • Related to bug #8626: NullPointerException (NPE) on saving Specimen Editor (list) added
Actions #15

Updated by Katja Luther about 3 years ago

  • Related to deleted (bug #8626: NullPointerException (NPE) on saving Specimen Editor (list))
Actions #16

Updated by Katja Luther about 3 years ago

  • Has duplicate bug #8626: NullPointerException (NPE) on saving Specimen Editor (list) added
Actions #17

Updated by Andreas Müller about 3 years ago

  • Status changed from Feedback to New
  • Target version changed from Reviewed Next Major Release to Release 5.13

This exception appears quite often therefore I put it to the current milestone.

We need to find to handle it so that reopening the TaxEditor is not necessary anymore. And ofcourse it would be good to find out why it happens at all.

Actions #18

Updated by Andreas Kohlbecker about 3 years ago

  • Tags set to RemoteAccessException
Actions #19

Updated by Andreas Kohlbecker almost 3 years ago

  • Description updated (diff)

Another report of the same issue:

Hallo,

der bulk editor ist nicht zugänglich, das ist die Fehlermeldung, die kommt.

viele Grüße
Nadja



last remote method : http://api.cybertaxonomy.org:80/caryophyllales_spp/remoting/reference.service
last remote request client time : 2020-02-19T15:46:47.448
last remote request response header time : Wed, 19 Feb 2020 15:46:47 GMT
client error time : 2020-02-19T15:46:47.507
login :
editor version : 5.12.0
server :  ()
schema version :
os : Windows 7 6.1 amd64
java : 1.8.0_20
org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://api.cybertaxonomy.org:80/caryophyllales_spp/remoting/reference.service]; nested exception is java.lang.NullPointerException
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:216)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:147)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
                at com.sun.proxy.$Proxy91.findByTitle(Unknown Source)
                at eu.etaxonomy.taxeditor.store.SearchManager.findReferences(SearchManager.java:97)
                at eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput.listEntities(ReferenceEditorInput.java:128)
                at eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput.lambda$0(AbstractBulkEditorInput.java:280)
                at eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput$$Lambda$77/494966836.run(Unknown Source)
                at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:186)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getCacheElement(CdmTransientEntityCacher.java:288)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getFromCache(CdmTransientEntityCacher.java:293)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.put(CdmTransientEntityCacher.java:261)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:268)
                at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:293)
                at eu.etaxonomy.cdm.cache.CacheLoader.loadRecursive(CacheLoader.java:84)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:184)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:155)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:69)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.load(CdmTransientEntityCacher.java:157)
                at eu.etaxonomy.taxeditor.session.CdmEntitySession.load(CdmEntitySession.java:70)
                at eu.etaxonomy.taxeditor.session.CdmEntitySessionManager.load(CdmEntitySessionManager.java:131)
                at eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor.doExecuteRequest(CdmServiceRequestExecutor.java:82)
                at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:138)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:194)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:176)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:144)
                ... 9 more
Actions #20

Updated by Andreas Kohlbecker almost 3 years ago

  • Tags deleted (RemoteAccessException)
Actions #21

Updated by Andreas Kohlbecker almost 3 years ago

As far as I am understanding this problem it is the bulk editors which can be saved or closed while a search process is still running in a subthread. These sub threads are started in AbstractBulkEditorInput.performSearch(BulkEditorQuery bulkEditorQuery, IStructuredSelection selection)

In case of saving or even closing the editor the following code is execued:

public void save(IProgressMonitor monitor, boolean resetMerge) {
        ...
        input.dispose(); // calls internally cdmTransientEntityCacher.dispose();
        input.bind();
        ...
        if (lastQuery != null){
            // NOTE AK: what if a search is already in progress here?
            bulkEditorComposite.performSearch(lastQuery, selection);
        }
    }

    @PreDestroy
    public void dispose() {
            ...
        if(input!=null){
            input.dispose(); // calls internally cdmTransientEntityCacher.dispose();
        }
        ...
        }

The CachingHttpInvokerProxyFactoryBean (formerly CdmServiceRequestExecutor as shown in the stack traces here) will load the retuned entities into the cache by calling in principle

CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager().load()

which internally uses

 tlActiveSession.get().load(obj, update);

since tlActiveSession is an InheritableThreadLocal object the CdmEntitySession of the parent thread, that is of the bulkeditor thread is being accessed. The session could be disposed at this time, which means that cdmTransientEntityCacher.dispose(); has been executed and CdmTransientEntityCacher.getCache() will return null. This can happen either after a call to the BulkEditorE4.dispose() method or during BulkEditorE4.save() while being in the middle of dispose() and bind().

A solution to this problem would be to kill the search thread being in progress. This would require calling job.getThread().stop() since job.cancel() seems to wait for the job to gracefully shut down, which is not what we want in this case.

BTW: I also stumbled over these lines of code in .AbstractBulkEditorInput.performSearch(BulkEditorQuery bulkEditorQuery, IStructuredSelection selection):


    public void performSearch(final BulkEditorQuery bulkEditorQuery, IStructuredSelection selection) {
        //cancel previous search job
        if(searchJob!=null && searchJob.getState()!=Job.NONE){
            searchJob.cancel();
            searchJob = null;
            /*
             * wait for a little while for the job to finish
             * to avoid asynchronously loaded results of the
             * previous search being shown in the next search
             * (not critical but explicitly waiting for the job to finish
             * could run into an endless loop by mistake)
             */
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
            }
        }

This seems not to be right since sleeping for half a second is not always enough. Think about massive searches or low data rate connections! I t would be better to kill the thread as suggested above.

However, there is one point which does not yet fit into this picture. After this phenomenon has appeared it is needed to restart the editor. It should be sufficient to just close the bulkeditor to heal the situation.

Actions #22

Updated by Katja Luther almost 3 years ago

  • Target version changed from Release 5.13 to Release 5.14
Actions #23

Updated by Andreas Kohlbecker almost 3 years ago

  • Has duplicate bug #8923: NullPointerException (NPE) after attempt to save invalid Group name added
Actions #24

Updated by Andreas Müller almost 3 years ago

  • Target version changed from Release 5.14 to Release 5.15
Actions #25

Updated by Katja Luther almost 3 years ago

  • Target version changed from Release 5.15 to Release 5.18
Actions #26

Updated by Andreas Müller over 2 years ago

  • Related to bug #9174: After longer inactivity NPE for cache added
Actions #27

Updated by Katja Luther about 2 years ago

  • Target version changed from Release 5.18 to Release 5.19
Actions #28

Updated by Katja Luther about 2 years ago

Andreas Kohlbecker wrote:

As far as I am understanding this problem it is the bulk editors which can be saves or closed while a search process is still running in a subthread. These sub threads are started in AbstractBulkEditorInput.performSearch(BulkEditorQuery bulkEditorQuery, IStructuredSelection selection)

In case of saving or even closing the editor the following code is execued:

since tlActiveSession is an InheritableThreadLocal object the CdmEntitySession of the parent thread, that is of the bulkeditor thread is being accessed. The session could be disposed at this time, which means that cdmTransientEntityCacher.dispose(); has been executed and CdmTransientEntityCacher.getCache() will return null. This can happen either after a call to the BulkEditorE4.dispose() method or during BulkEditorE4.save() while being in the middle of dispose() and bind().

A solution to this problem would be to kill the search thread being in progress. This would require calling job.getThread().stop() since job.cancel() seems to wait for the job to gracefully shut down, which is not what we want in this case.

BTW: I also stumbled over these lines of code in .AbstractBulkEditorInput.performSearch(BulkEditorQuery bulkEditorQuery, IStructuredSelection selection):

I did some more research and thread.stop() is deprecated and should not be used anymore, therefore I would add the following code to be sure that the thread is closed.

 boolean isCanceled = searchJob.cancel();
     if (!isCanceled){
         while (!isCanceled){
             try {
                 Thread.sleep(200);
             } catch (InterruptedException e) {
             }
             isCanceled = searchJob.cancel();
       }
         }
     searchJob = null;

Actions #29

Updated by Andreas Kohlbecker about 2 years ago

This way is would be more concise:

         boolean isCanceled = false; 
         while (true){
             try {
                 Thread.sleep(200);
             } catch (InterruptedException e) {
             }
             isCanceled = searchJob.cancel(); 
             if(isCanceled){
               break;
             }
       }

       // do something with isCanceled ....
Actions #30

Updated by Katja Luther about 2 years ago

There was the same issue while working with character matrix:

mail NK:

hm, es scheint aber doch noch ein Problem zu geben: Ich gebe heute seit einer Weile die Daten aus dem letzten Kurs in die aktuelle Matrix ein, habe eigentlich auch öfter gespeichert, aber dann geht der TaxEditor in den (Keine Rückmeldung)-Modus und scheint auch nicht mehr herauszukommen. Das klingt so wie bei Max, nur dass ich bloß den Editor zwangsschließen und neu laden muss, nicht den ganzen Rechner.

stacktrace in log file:

[http://160.45.63.231:80/cdmserver/greece_bupleurum_01_with_onthology/remoting/media.service]; nested exception is java.lang.NullPointerException
                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.$Proxy61.load(Unknown Source)
                at eu.etaxonomy.taxeditor.view.search.facet.term.TermSearchResultComposite$2.run(TermSearchResultComposite.java:122)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getCacheElement(CdmTransientEntityCacher.java:266)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getFromCache(CdmTransientEntityCacher.java:270)
                at eu.etaxonomy.cdm.cache.CdmTransientEntityCacher.getFromCache(CdmTransientEntityCacher.java:293)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:248)
                at eu.etaxonomy.cdm.cache.CacheLoader.load(CacheLoader.java:62)
                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:100)
                at org.springframework.remoting.httpinvoker.CachingHttpInvokerProxyFactoryBean.executeRequest(CachingHttpInvokerProxyFactoryBean.java:81)
                at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:150)
                ... 5 more

The exception comes from TermSearchResultComposite not CharacterMatrix.

Actions #31

Updated by Andreas Müller about 2 years ago

  • Target version changed from Release 5.19 to Release 5.21
Actions #32

Updated by Andreas Müller almost 2 years ago

  • Target version changed from Release 5.21 to Release 5.22
Actions #33

Updated by Katja Luther almost 2 years ago

  • Target version changed from Release 5.22 to Release 5.38
Actions #34

Updated by Andreas Müller almost 2 years ago

  • Severity changed from normal to major

As this problem (see also duplicates) appears again and again from time to time I increase severity.

Actions #35

Updated by Andreas Müller 2 months ago

  • Related to deleted (bug #9174: After longer inactivity NPE for cache)
Actions #36

Updated by Andreas Müller 2 months ago

  • Has duplicate bug #9174: After longer inactivity NPE for cache added
Actions #37

Updated by Andreas Müller 2 months ago

  • Subject changed from NPE when searching for specimen in bulk editor to NPE in CdmTransientEntityCacher.getCacheElement()
Actions #38

Updated by Andreas Müller 2 months ago

  • Description updated (diff)
Actions #39

Updated by Andreas Müller 2 months ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • Target version changed from Release 5.38 to Release 5.35
Actions #40

Updated by Andreas Müller 2 months ago

  • Description updated (diff)
Actions #42

Updated by Andreas Müller 2 months ago

  • % Done changed from 0 to 10
Actions #43

Updated by Andreas Müller 2 months ago

  • Assignee changed from Katja Luther to Andreas Müller
Actions #44

Updated by Andreas Müller 2 months ago

  • Related to bug #10186: Problems with session handling in taxeditor added
Actions #45

Updated by Andreas Müller 2 months ago

  • Target version changed from Release 5.35 to Release 5.36

Now an explicit error is thrown with message "No cache available for cacheId = xxx" and some debug information.
For now, we have to wait until the problem occurs again and that we get some more debug information. Therefore moving to next milestone.

Close it if it does not appear after >6 month anymore

Actions

Also available in: Atom PDF