[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3208?page=c...
]
Karol Nowak commented on HHH-3208:
----------------------------------
Actually, I made a mistake in the original submission - the cause of the NPE was not a
wrong value of property-ref - it was a mistyped name of the class in <many-to-one>.
I believe the report is still valid...
NullPointerException thrown in ManyToOne.java
---------------------------------------------
Key: HHH-3208
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3208
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6; Database: N/A
Reporter: Karol Nowak
Hibernate dies with ExceptionInInitializerError due to a NullPointerException being
thrown in ManyToOne.java (see the trace below) when a property-ref attribute is set to a
nonexistent property group. That's annoying and difficult to debug. Instead, Hibernate
should inform that there's no matching group.
java.lang.ExceptionInInitializerError
at com.sabre.fs.emd.or.HibernateUtil.<clinit>(HibernateUtil.java:20)
at com.sabre.fs.emd.query.Executor.<init>(Executor.java:82)
at com.sabre.fs.emd.query.ExecutorTest.beforeTest(ExecutorTest.java:64)
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:585)
at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
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)
Caused by: java.lang.NullPointerException
at org.hibernate.mapping.ManyToOne.createPropertyRefConstraints(ManyToOne.java:47)
at org.hibernate.cfg.HbmBinder$ManyToOneSecondPass.doSecondPass(HbmBinder.java:2717)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at com.sabre.fs.emd.or.HibernateUtil.<clinit>(HibernateUtil.java:15)
... 22 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira