Monday, 17 August 2015

Exception at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass)

You might end up with this exception while doing your one to one ,or many to one relationship in hibernate.

Exception:
Exception in thread "main" java.lang.NullPointerException
 at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135)
 at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1127)
 at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1283)
 at com.javatpoint.Test.main(Test.java:13)


To fix correct this exception Check following :

1. Your one to one mapping bean is pointing to correct column.
2. You have configured both table correctly.

Once you have correct these your exception will go away.


No comments:

Post a Comment

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...