Project

General

Profile

bug #9672

NPE when CDMPreference contains allowOverride=NULL

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

Status:
Duplicate
Priority:
New
Category:
data
Target version:
Start date:
06/16/2021
Due date:
% Done:

0%

Severity:
normal
Found in Version:

Description

eu.etaxonomy.cdm.api.service.MediaServiceImpl.readResourceMetadataFiltered(MediaRepresentation representation) throws IOException, HttpException

bei

key_subject key_predicate value allowOverride
/ media.metadataKeyword.icludes title,artist,rights,location,copyright,date,photographer,locality,taxon,collection,description,Source,https,ID,CC licence NULL

gibt der IIIF Service nichts zurück, habe aber auch nicht im Log geschaut. Das kann nur ein NPE sein.

Interner Nachtrag:

Wenn man in den CdmPreferences für allowOverride NULL eingibt, passiert irgendwo eine NPE. Das sollen wir und mal ansehen.
Stacktrace habe ich keinen.


Related issues

Related to Edit - task #9673: Remove allowNull from allowOverride New 06/16/2021

History

#1 Updated by Katja Luther 4 months ago

  • Category set to cdmlib
  • Assignee set to Katja Luther

#2 Updated by Andreas Kohlbecker 4 months ago

  • Description updated (diff)

#3 Updated by Andreas Kohlbecker 4 months ago

  • Tags set to fast
  • Assignee changed from Katja Luther to Andreas Müller
  • Target version changed from Unassigned CDM tickets to Release 5.25

Hier ist der Stacktrace:

Caused by: java.lang.IllegalArgumentException: Can not set boolean field eu.etaxonomy.cdm.model.metadata.CdmPreference.allowOverride to null value
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
    at sun.reflect.UnsafeBooleanFieldAccessorImpl.set(UnsafeBooleanFieldAccessorImpl.java:80)
    at java.lang.reflect.Field.set(Field.java:764)
    at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:38)
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:713)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:207)
    at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:4706)
    at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:183)
    at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125)
    at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.performTwoPhaseLoad(AbstractRowReader.java:238)
    at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.finishUp(AbstractRowReader.java:209)
    at org.hibernate.loader.plan.exec.process.internal.ResultSetProcessorImpl.extractResults(ResultSetProcessorImpl.java:133)
    at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:122)
    at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:86)
    at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:167)
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4083)
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:508)
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:478)
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219)
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:262)
    at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121)
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89)
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1142)
    at org.hibernate.internal.SessionImpl.access$2600(SessionImpl.java:167)
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2762)
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2741)
    at org.hibernate.internal.SessionImpl.get(SessionImpl.java:978)
    at eu.etaxonomy.cdm.persistence.dao.hibernate.common.PreferenceDaoImpl.get(PreferenceDaoImpl.java:41)
    at eu.etaxonomy.cdm.api.service.PreferenceServiceImpl.lambda$0(PreferenceServiceImpl.java:186)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
    at eu.etaxonomy.cdm.api.service.PreferenceServiceImpl.fromCacheGet(PreferenceServiceImpl.java:186)
    at eu.etaxonomy.cdm.api.service.PreferenceServiceImpl.findExact(PreferenceServiceImpl.java:58)
    at sun.reflect.GeneratedMethodAccessor633.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:333)
    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:283)
    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:213)
    at com.sun.proxy.$Proxy198.findExact(Unknown Source)
    at eu.etaxonomy.cdm.api.service.MediaServiceImpl.mediaMetadataKeyIncludes(MediaServiceImpl.java:345)
    at eu.etaxonomy.cdm.api.service.MediaServiceImpl.readResourceMetadataFiltered(MediaServiceImpl.java:293)
    at sun.reflect.GeneratedMethodAccessor690.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:333)
    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:283)
    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:213)
    at com.sun.proxy.$Proxy199.readResourceMetadataFiltered(Unknown Source)
    at eu.etaxonomy.cdm.remote.controller.iiif.ManifestComposer.createCanvas(ManifestComposer.java:246)
    at eu.etaxonomy.cdm.remote.controller.iiif.ManifestComposer.lambda$0(ManifestComposer.java:148)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:747)
    at java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:721)
    at java.util.stream.AbstractTask.compute(AbstractTask.java:316)
    at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401)
    at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734)
    at java.util.stream.ReduceOps$ReduceOp.evaluateParallel(ReduceOps.java:714)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at eu.etaxonomy.cdm.remote.controller.iiif.ManifestComposer.manifestFor(ManifestComposer.java:155)
    ... 81 more

Entweder muss das Datenbankfeld ein NOT NULL contraint bekommen oder CdmPreference.allowOverride muss Boolean statt boolean sein.

Damit fällt das in deinen Bereich Andreas,

#4 Updated by Andreas Kohlbecker 4 months ago

  • Subject changed from NPE in MediaServiceImpl.readResourceMetadataFiltered when CDMPreference contains allowOverride=true to NPE in MediaServiceImpl.readResourceMetadataFiltered when CDMPreference contains allowOverride=NULL

#5 Updated by Andreas Kohlbecker 4 months ago

  • Subject changed from NPE in MediaServiceImpl.readResourceMetadataFiltered when CDMPreference contains allowOverride=NULL to NPE when CDMPreference contains allowOverride=NULL

#6 Updated by Andreas Müller 4 months ago

  • Category changed from cdmlib to data
  • Status changed from New to In Progress
  • Assignee changed from Andreas Müller to Andreas Kohlbecker

Allow override must never be NULL (even if the schema for historical reasons allwos null). Please adapt data in your database.

#7 Updated by Andreas Müller 4 months ago

  • Related to task #9673: Remove allowNull from allowOverride added

#8 Updated by Andreas Müller 4 months ago

I added a ticket which should try to set the allowOverride to allowNull=false if possible (unfortunately not trival via update script): #9673

#9 Updated by Andreas Müller 4 months ago

Is this ticket really only about "allowOverride=NULL"? I ask because there is so much additional information in the description which is not related to this data error.

#10 Updated by Katja Luther 4 months ago

Andreas Müller wrote:

Is this ticket really only about "allowOverride=NULL"? I ask because there is so much additional information in the description which is not related to this data error.

when I created the ticket I did not know that the ticket was only about the NULL value for allowOverride therefore I added the whole mail conversation, but now we can reduce it.

#11 Updated by Andreas Müller 3 months ago

  • Status changed from In Progress to Feedback

I think this ticket can be closed (after reducing the description), as the only open issue is handled in #9673

#12 Updated by Andreas Kohlbecker 3 months ago

  • Description updated (diff)
  • Status changed from Feedback to Duplicate

closing as duplicate of #9673

#13 Updated by Andreas Kohlbecker 3 months ago

  • Tags deleted (fast)

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)