java.lang.ExceptionInInitializerError

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.

  • Sequence is not generating
    via Stack Overflow by Shiladittya Chakraborty
    ,
  • My hibernate.reveng.xml contains the following: <table catalog="Swan" schema="InsuranceLedger" name="jouJournal"> <primary-key> <generator class="IDENTITY"></generator> </primary-key> </table> This results in the following annotations on my @Id field when generating annotated Java: @GenericGenerator(name="generator", strategy="IDENTITY", parameters = { } ) @Id @GeneratedValue(generator="generator") @Column(name="jouSID", unique=true, nullable=false, insertable=true, updatable=true) public Long getsID() { return this.sID; } Which results in the following error at runtime: org.hibernate.MappingException: could not instantiate id generator at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:97) at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:181) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) at com.catlin.architecture.dao.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:80) at com.catlin.insuranceledger.JournalTest.setUp(JournalTest.java:38) 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) Caused by: org.hibernate.MappingException: could not interpret id generator strategy: IDENTITY at org.hibernate.id.IdentifierGeneratorFactory.getIdentifierGeneratorClass(IdentifierGeneratorFactory.java:108) at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:91) ... 15 more Replacing the generated annotation with the following works fine: @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="jouSID", unique=true, nullable=false, insertable=true, updatable=true) public Long getsID() { return this.sID; }
    via by Matt Read,
    • java.lang.ExceptionInInitializerError at util.HibernateUtil.<clinit>(HibernateUtil.java:22) at introducaohibernate01.ProfessorDAO.salvarProfessor(ProfessorDAO.java:17) at introducaohibernate01.Main.main(Main.java:24) Caused by: org.hibernate.MappingException: could not instantiate id generator at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:98) at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:192) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859) at util.HibernateUtil.<clinit>(HibernateUtil.java:18) ... 2 more Caused by: org.hibernate.MappingException: could not interpret id generator strategy: codigo_seq at org.hibernate.id.IdentifierGeneratorFactory.getIdentifierGeneratorClass(IdentifierGeneratorFactory.java:109) at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:92) ... 7 more
    No Bugmate found.