java.lang.IllegalStateException: Could not get property value

Hibernate JIRA | John Delzer | 4 years ago
  1. 0

    I get the following exception when attempting to perform a {{FullTextSession.purge()}} on an indexed entity that is embedded in another indexed entity. {noformat} java.lang.IllegalStateException: Could not get property value at org.hibernate.search.util.impl.ReflectionHelper.getMemberValue(ReflectionHelper.java:94) at org.hibernate.search.engine.spi.AbstractDocumentBuilder.appendContainedInWorkForInstance(AbstractDocumentBuilder.java:265) at org.hibernate.search.engine.impl.WorkPlan$PerEntityWork.processContainedIn(WorkPlan.java:525) at org.hibernate.search.engine.impl.WorkPlan$PerClassWork.processContainedInAndPrepareExecution(WorkPlan.java:297) at org.hibernate.search.engine.impl.WorkPlan.processContainedInAndPrepareExecution(WorkPlan.java:144) at org.hibernate.search.backend.impl.WorkQueue.prepareWorkPlan(WorkQueue.java:135) at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:71) at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.flushWorks(PostTransactionWorkQueueSynchronization.java:124) at org.hibernate.search.backend.impl.TransactionalWorker.flushWorks(TransactionalWorker.java:179) at org.hibernate.search.impl.FullTextSessionImpl.flushToIndexes(FullTextSessionImpl.java:136) at test.TU_FullTextSessionPurge.testFullTextSessionPurge(TU_FullTextSessionPurge.java:195) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.IllegalArgumentException: Invoking relatedEntityBs on a null object at org.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:81) at org.hibernate.search.util.impl.ReflectionHelper.getMemberValue(ReflectionHelper.java:91) ... 35 more Caused by: java.lang.NullPointerException 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.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:74) ... 36 more {noformat} From what I can tell, the Work object created by .purge() to handle the index deletion is created with a null "entity" value. Later, when the Work is being handled (by flushToIndexes()) the system tries to access the entity class' property annotated with @ContainedIn but the Work's "entity" instance is null so the method invocation fails. Related forum post: https://forum.hibernate.org/viewtopic.php?f=9&t=1025336&start=0

    Hibernate JIRA | 4 years ago | John Delzer
    java.lang.IllegalStateException: Could not get property value
  2. 0

    I get the following exception when attempting to perform a {{FullTextSession.purge()}} on an indexed entity that is embedded in another indexed entity. {noformat} java.lang.IllegalStateException: Could not get property value at org.hibernate.search.util.impl.ReflectionHelper.getMemberValue(ReflectionHelper.java:94) at org.hibernate.search.engine.spi.AbstractDocumentBuilder.appendContainedInWorkForInstance(AbstractDocumentBuilder.java:265) at org.hibernate.search.engine.impl.WorkPlan$PerEntityWork.processContainedIn(WorkPlan.java:525) at org.hibernate.search.engine.impl.WorkPlan$PerClassWork.processContainedInAndPrepareExecution(WorkPlan.java:297) at org.hibernate.search.engine.impl.WorkPlan.processContainedInAndPrepareExecution(WorkPlan.java:144) at org.hibernate.search.backend.impl.WorkQueue.prepareWorkPlan(WorkQueue.java:135) at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:71) at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.flushWorks(PostTransactionWorkQueueSynchronization.java:124) at org.hibernate.search.backend.impl.TransactionalWorker.flushWorks(TransactionalWorker.java:179) at org.hibernate.search.impl.FullTextSessionImpl.flushToIndexes(FullTextSessionImpl.java:136) at test.TU_FullTextSessionPurge.testFullTextSessionPurge(TU_FullTextSessionPurge.java:195) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.IllegalArgumentException: Invoking relatedEntityBs on a null object at org.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:81) at org.hibernate.search.util.impl.ReflectionHelper.getMemberValue(ReflectionHelper.java:91) ... 35 more Caused by: java.lang.NullPointerException 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.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:74) ... 36 more {noformat} From what I can tell, the Work object created by .purge() to handle the index deletion is created with a null "entity" value. Later, when the Work is being handled (by flushToIndexes()) the system tries to access the entity class' property annotated with @ContainedIn but the Work's "entity" instance is null so the method invocation fails. Related forum post: https://forum.hibernate.org/viewtopic.php?f=9&t=1025336&start=0

    Hibernate JIRA | 4 years ago | John Delzer
    java.lang.IllegalStateException: Could not get property value
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    trying and failing to do java functions

    Stack Overflow | 3 years ago | Shani Paley
    java.lang.NullPointerException

  1. tyson925 1 times, last 1 month ago
  2. ajinkya_w 2 times, last 2 months ago
  3. Ajeet 8 times, last 3 months ago
  4. qavid 2 times, last 6 months ago
  5. Nikolay Rybak 11 times, last 6 months ago
2 more registered users
11 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NullPointerException

    No message provided

    at sun.reflect.NativeMethodAccessorImpl.invoke0()
  2. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    4. java.lang.reflect.Method.invoke(Unknown Source)
    4 frames
  3. Hibernate Commons Annotations
    JavaXProperty.invoke
    1. org.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:74)
    1 frame
  4. Hibernate Search Engine
    FullTextSessionImpl.flushToIndexes
    1. org.hibernate.search.util.impl.ReflectionHelper.getMemberValue(ReflectionHelper.java:91)
    2. org.hibernate.search.engine.spi.AbstractDocumentBuilder.appendContainedInWorkForInstance(AbstractDocumentBuilder.java:265)
    3. org.hibernate.search.engine.impl.WorkPlan$PerEntityWork.processContainedIn(WorkPlan.java:525)
    4. org.hibernate.search.engine.impl.WorkPlan$PerClassWork.processContainedInAndPrepareExecution(WorkPlan.java:297)
    5. org.hibernate.search.engine.impl.WorkPlan.processContainedInAndPrepareExecution(WorkPlan.java:144)
    6. org.hibernate.search.backend.impl.WorkQueue.prepareWorkPlan(WorkQueue.java:135)
    7. org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:71)
    8. org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.flushWorks(PostTransactionWorkQueueSynchronization.java:124)
    9. org.hibernate.search.backend.impl.TransactionalWorker.flushWorks(TransactionalWorker.java:179)
    10. org.hibernate.search.impl.FullTextSessionImpl.flushToIndexes(FullTextSessionImpl.java:136)
    10 frames
  5. test
    TU_FullTextSessionPurge.testFullTextSessionPurge
    1. test.TU_FullTextSessionPurge.testFullTextSessionPurge(TU_FullTextSessionPurge.java:195)
    1 frame
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    4. java.lang.reflect.Method.invoke(Unknown Source)
    4 frames
  7. JUnit
    ParentRunner.run
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    5. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    6. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    7. org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    9. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    10. org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    11. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    12. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    13. org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    14. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    15. org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    15 frames
  8. JUnit4 Runner
    JUnit4TestReference.run
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    1 frame
  9. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    5 frames