java.lang.IllegalStateException

Could not set value [com.google.code.twig.SetPersistenceTest$Bar@e4600c0] to field private java.util.Set com.google.code.twig.SetPersistenceTest$Foo.bars

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web515

  • via Unknown by Miroslav Genov,
  • Stack trace

    • java.lang.IllegalStateException: Could not set value [com.google.code.twig.SetPersistenceTest$Bar@e4600c0] to field private java.util.Set com.google.code.twig.SetPersistenceTest$Foo.bars at com.google.code.twig.translator.FieldTranslator.setFieldValue(FieldTranslator.java:201) at com.google.code.twig.translator.FieldTranslator.decodeField(FieldTranslator.java:188) at com.google.code.twig.standard.TranslatorObjectDatastore$ObjectFieldTranslator.decodeField(TranslatorObjectDatastore.java:981) at com.google.code.twig.translator.FieldTranslator.decode(FieldTranslator.java:127) at com.google.code.twig.standard.StandardDecodeCommand.entityToInstance(StandardDecodeCommand.java:118) at com.google.code.twig.standard.StandardDecodeCommand.keyToInstance(StandardDecodeCommand.java:205) at com.google.code.twig.standard.StandardSingleTypedLoadCommand.keyToInstance(StandardSingleTypedLoadCommand.java:9) at com.google.code.twig.standard.StandardSingleTypedLoadCommand.now(StandardSingleTypedLoadCommand.java:34) at com.google.code.twig.SetPersistenceTest.getStoredSetOfRelatedEntities(SetPersistenceTest.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.junit.runner.JUnitCore.run(JUnitCore.java:130) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Can not set java.util.Set field com.google.code.twig.SetPersistenceTest$Foo.bars to java.util.ArrayList at com.google.code.twig.util.Reflection.set(Reflection.java:140) at com.google.code.twig.translator.FieldTranslator.setFieldValue(FieldTranslator.java:197) ... 26 more Caused by: java.lang.IllegalArgumentException: Can not set java.util.Set field com.google.code.twig.SetPersistenceTest$Foo.bars to java.util.ArrayList at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150) at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63) at java.lang.reflect.Field.set(Field.java:657) at com.google.code.twig.util.Reflection.set(Reflection.java:136) ... 28 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    PilleoPilleo
    6 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Andreas HäberAndreas Häber
    5 times, last one
    linxiaolonglinxiaolong
    8 times, last one
    61 more bugmates