Project

General

Profile

bug #6978

NPE in DefaultReferenceCacheStrategy

Added by Andreas Kohlbecker over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
New
Category:
cdmlib
Target version:
Start date:
09/22/2017
Due date:
% Done:

0%

Severity:
normal
Found in Version:

Description

OAIPMH Service call broken by a bug in in the DefaultReferenceCacheStrategy:

http://test.e-taxonomy.eu/cdmserver/flora_cuba/reference/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&set=reference

java.lang.NullPointerException
    at eu.etaxonomy.cdm.strategy.cache.reference.DefaultReferenceCacheStrategy.isNomRef(DefaultReferenceCacheStrategy.java:481)
    at eu.etaxonomy.cdm.strategy.cache.reference.DefaultReferenceCacheStrategy.getTitleCache(DefaultReferenceCacheStrategy.java:114)
    at eu.etaxonomy.cdm.strategy.cache.reference.DefaultReferenceCacheStrategy.getTitleCache(DefaultReferenceCacheStrategy.java:1)
    at eu.etaxonomy.cdm.model.common.IdentifiableEntity.generateTitle(IdentifiableEntity.java:581)
    at eu.etaxonomy.cdm.model.reference.Reference.generateTitle(Reference.java:838)
    at eu.etaxonomy.cdm.model.common.IdentifiableEntity.getTitleCache(IdentifiableEntity.java:211)
    at eu.etaxonomy.cdm.model.reference.Reference.getTitleCache(Reference.java:431)
    at eu.etaxonomy.cdm.persistence.dao.initializer.TitleAndNameCacheAutoInitializer.initialize(TitleAndNameCacheAutoInitializer.java:85)
    at eu.etaxonomy.cdm.persistence.dao.initializer.TitleAndNameCacheAutoInitializer.initialize(TitleAndNameCacheAutoInitializer.java:30)
    at eu.etaxonomy.cdm.persistence.dao.initializer.AbstractBeanInitializer.invokePropertyAutoInitializers(AbstractBeanInitializer.java:353)
    at eu.etaxonomy.cdm.persistence.dao.initializer.AdvancedBeanInitializer.autoinitializeBean(AdvancedBeanInitializer.java:376)
    at eu.etaxonomy.cdm.persistence.dao.initializer.AdvancedBeanInitializer.initializeAll(AdvancedBeanInitializer.java:70)
    at eu.etaxonomy.cdm.persistence.dao.initializer.AdvancedBeanInitializer.initialize(AdvancedBeanInitializer.java:57)
    at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.getAuditEvents(VersionableDaoBase.java:389)
    at eu.etaxonomy.cdm.api.service.VersionableServiceBase.pageAuditEvents(VersionableServiceBase.java:67)

History

#1 Updated by Andreas Müller over 1 year ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker

This is not necessarily a bug

    protected static boolean isNomRef(ReferenceType type){
        switch (type){
            case Article:
            case Book:
            case BookSection:

The exception happens in the second line, where the type of the reference is passed.
A reference should ALWAYS have a type therefore we do not need a null check here.

The strange thing is that there is no Reference with RefType IS NULL in cuba test DB.

BUT in the strackstrace there are lines

    at eu.etaxonomy.cdm.persistence.dao.initializer.AdvancedBeanInitializer.initialize(AdvancedBeanInitializer.java:57)
    at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.getAuditEvents(VersionableDaoBase.java:389)
    at eu.etaxonomy.cdm.api.service.VersionableServiceBase.pageAuditEvents(VersionableServiceBase.java:67)

so it looks like this has to do wiht Auditing. Maybe old version of Reference are loaded. But also here only reference of REVTYPE = 2 (Deleted) exist. Ofcourse these do not have a refType as they are completely empty.

To me this looks more like a problem in the AbstractOaiPmhController. Why does it call methods to retrieve auditing data in AbstractOaiPmhController.listIdentifiers(). Or maybe it is a bit more down in the stack somewhere in the Auditing functionality.

Reassign to AK as it is maybe related to AbstractOaiPmhController.

#2 Updated by Andreas Müller over 1 year ago

See similar issue #6979#note-1

#3 Updated by Andreas Kohlbecker over 1 year ago

  • Tags changed from oaipmh to oaipmh, hibernate_envers

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)