• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

java.lang.ExceptionInInitializerError

 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

This line: this.session = SessionFactoryUtil.getInstance().getCurrentSession();
gives the exception: Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError

The static initialization code in the SessionFactoryUtil class:


I took the class SessionFactoryUtil from here: http://www.laliluna.de/first-hibernate-example-tutorial.html

please, help me.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to put a try/catch block around those statements, and print the stack trace of the exception to your log file.
 
Leandro Coutinho
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You may want to put a try/catch block around those statements, and print the stack trace of the exception to your log file.


Thanks Ulf!

I did this:


And it prints:
17:34:49,282 INFO EntityBinder:424 - Bind entity com.tivrfoa.model.Meaning on table meanings
Unknown Id.generator: meanings_id_seq
Cause: null

I'm using PostgreSQL. The table meanings has a primary key called "meanings_pkey" and a sequence called "meanings_id_seq".

What should I try now?
 
Leandro Coutinho
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the solution here in this site =)

https://coderanch.com/t/217781/Object-Relational-Mapping/java/Unknown-Id-generator-Hibernate-exception
 
reply
    Bookmark Topic Watch Topic
  • New Topic