java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY, targetEntity = SolutionProvider.class) @Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE) private T provider; This mapping is unable to be handled by the AnnotationConfiguration session factory builder. It throws the following error: java.lang.NullPointerException at org.hibernate.cfg.PropertyInferredData.extractType(PropertyInferredData.java:212) at org.hibernate.cfg.PropertyInferredData.execute(PropertyInferredData.java:124) at org.hibernate.cfg.PropertyInferredData.skip(PropertyInferredData.java:60) at org.hibernate.cfg.AnnotationBinder.addAnnotatedElement(AnnotationBinder.java:900) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:868) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:717) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:547) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210) at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:647) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:96) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64) at uk.co.iizuka.common.hibernate.AbstractHibernateTest.setUp(AbstractHibernateTest.java:48) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) It worked fine in annotations version beta7.
    via by Matt Todd,
  • Hibernate / Mailing Lists
    via by Unknown author,
  • @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY, targetEntity = SolutionProvider.class) @Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE) private T provider; This mapping is unable to be handled by the AnnotationConfiguration session factory builder. It throws the following error: java.lang.NullPointerException at org.hibernate.cfg.PropertyInferredData.extractType(PropertyInferredData.java:212) at org.hibernate.cfg.PropertyInferredData.execute(PropertyInferredData.java:124) at org.hibernate.cfg.PropertyInferredData.skip(PropertyInferredData.java:60) at org.hibernate.cfg.AnnotationBinder.addAnnotatedElement(AnnotationBinder.java:900) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:868) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:717) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:547) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210) at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:647) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:96) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64) at uk.co.iizuka.common.hibernate.AbstractHibernateTest.setUp(AbstractHibernateTest.java:48) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) It worked fine in annotations version beta7.
    via by Matt Todd,
  • Creating DDL file with Hibernate
    via Stack Overflow by Chiara Di Nardo
    ,
  • very similar to that addressed in the following JIRA using hibernate annotations 3.2.0.CR2 http://opensource.atlassian.com/projects/hibernate/browse/ANN-95 The super class contains the members we are using for defining the constraint. The Super class: ---------------------------------------------------- @Entity(name="xpmComponent") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class Component... @NotNull @Length(max=40) @Index(name="manufacturerPartNumber") public String getManufacturerPartNumber() { return manufacturerPartNumber; } @ManyToOne @NotNull @JoinColumn(name="manufacturerId") public Manufacturer getManufacturer() { return manufacturer; } ... The Entity w/ Unique Constraint: ---------------------------------------------------- @Entity @Name("xpmProduct") @Table(name = "xPM_Product", uniqueConstraints={@UniqueConstraint( columnNames={"manufacturerPartNumber", "manufacturerId"})}) public class PersistentProduct extends Component... The Exception which occurs upon deployment ---------------------------------------------------- java.lang.NullPointerException at org.hibernate.mapping.UniqueKey.sqlConstraintString(UniqueKey.java:20) at org.hibernate.mapping.Table.sqlCreateString(Table.java:436) at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:779) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:74) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:688) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source) at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start()V(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) runnable testcase attached.
    via by Anthony Patricio,
    • java.lang.NullPointerException at org.hibernate.cfg.PropertyInferredData.extractType(PropertyInferredData.java:212) at org.hibernate.cfg.PropertyInferredData.execute(PropertyInferredData.java:124) at org.hibernate.cfg.PropertyInferredData.skip(PropertyInferredData.java:60) at org.hibernate.cfg.AnnotationBinder.addAnnotatedElement(AnnotationBinder.java:900) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:868) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:717) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:547) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210) at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:647) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:96) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64) at uk.co.iizuka.common.hibernate.AbstractHibernateTest.setUp(AbstractHibernateTest.java:48) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    No Bugmate found.