java.lang.NullPointerException

Hibernate JIRA | Vinnie Luther | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Merge a transient entity with a component mapping with a parent mapping causes java.lang.NullPointerException at org.hibernate.engine.StatefulPersistenceContext.proxyFor(StatefulPersistenceContext.java:693) at org.hibernate.type.ComponentType.instantiate(ComponentType.java:515) at org.hibernate.type.ComponentType.replace(ComponentType.java:482) at org.hibernate.type.TypeFactory.replace(TypeFactory.java:538) at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:429) at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:231) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:170) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:81) at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:704) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:688) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:692) at test.TransientMergeComponentParentTest.testTransientMergeComponentParent(TransientMergeComponentParentTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Removing @Parent mappings from component solved the problem. Attached is an eclipse project with demonstration minus the hibernate core 3.3.1, annotations 3.4.0 dependencies and hsqldb jar.

    Hibernate JIRA | 8 years ago | Vinnie Luther
    java.lang.NullPointerException
  2. 0

    Merge a transient entity with a component mapping with a parent mapping causes java.lang.NullPointerException at org.hibernate.engine.StatefulPersistenceContext.proxyFor(StatefulPersistenceContext.java:693) at org.hibernate.type.ComponentType.instantiate(ComponentType.java:515) at org.hibernate.type.ComponentType.replace(ComponentType.java:482) at org.hibernate.type.TypeFactory.replace(TypeFactory.java:538) at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:429) at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:231) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:170) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:81) at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:704) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:688) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:692) at test.TransientMergeComponentParentTest.testTransientMergeComponentParent(TransientMergeComponentParentTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Removing @Parent mappings from component solved the problem. Attached is an eclipse project with demonstration minus the hibernate core 3.3.1, annotations 3.4.0 dependencies and hsqldb jar.

    Hibernate JIRA | 8 years ago | Vinnie Luther
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.engine.StatefulPersistenceContext.proxyFor()
    2. Hibernate
      TypeFactory.replace
      1. org.hibernate.engine.StatefulPersistenceContext.proxyFor(StatefulPersistenceContext.java:693)
      2. org.hibernate.type.ComponentType.instantiate(ComponentType.java:515)
      3. org.hibernate.type.ComponentType.replace(ComponentType.java:482)
      4. org.hibernate.type.TypeFactory.replace(TypeFactory.java:538)
      4 frames
    3. Hibernate
      SessionImpl.merge
      1. org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:429)
      2. org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:231)
      3. org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:170)
      4. org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:81)
      5. org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:704)
      6. org.hibernate.impl.SessionImpl.merge(SessionImpl.java:688)
      7. org.hibernate.impl.SessionImpl.merge(SessionImpl.java:692)
      7 frames
    4. test
      TransientMergeComponentParentTest.testTransientMergeComponentParent
      1. test.TransientMergeComponentParentTest.testTransientMergeComponentParent(TransientMergeComponentParentTest.java:31)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    6. JUnit
      TestClassRunner.run
      1. org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
      2. org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
      3. org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
      4. org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
      5. org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
      6. org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
      7. org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
      8. org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
      9. org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
      10. org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
      10 frames
    7. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
      1 frame
    8. 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:460)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      5 frames