• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.ExceptionInInitializerError

 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • 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.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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: 423
  • Mark post as helpful
  • send pies
  • 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: 423
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic