These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Newbie getting java.lang.ExceptionInInitializerError
PostPosted: Tue Aug 28, 2007 9:26 am 
Newbie

Joined: Tue Aug 28, 2007 9:16 am
Posts: 3
Hi Guys,

I am new to Hibernate and I followed the examples in the Data Persistence in Hibernate book. It all worked fine. I then tried to develop my own application on a new machine and it gave me the following error:

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.hibernate.cfg.Configuration.reset(Configuration.java:168)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:187)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:191)
at uk.co.accris.bookshop.HibernateTester.<init>(HibernateTester.java:28)
at uk.co.accris.bookshop.TestContainer.main(TestContainer.java:20)
Caused by: java.lang.NullPointerException
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:144)
at org.hibernate.cfg.Environment.<clinit>(Environment.java:529)
... 5 more


I tried to re-run my test application, which I copied over, and it gives the same error. I am assuming that something is no longer on the path, but what and how do I fix it?

I am really desperate as I have to show Hibernate working tomorrow to the project manager.

TIA
Chad


Top
 Profile  
 
 Post subject: hibernate.properties
PostPosted: Tue Aug 28, 2007 1:22 pm 
Newbie

Joined: Tue Aug 28, 2007 12:54 pm
Posts: 16
Location: Munich, Germany
Well, Environment:529 is
Code:
         
InputStream stream = ConfigHelper.getResourceAsStream("/hibernate.properties");


so go check whether your hibernate.properties is in the classpath...

Cheers, Tom.

_________________
www.tomeicher.de


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 3:50 am 
Newbie

Joined: Tue Aug 28, 2007 9:16 am
Posts: 3
Thanks Tom,

How did you get the error meaning?


Top
 Profile  
 
 Post subject: Check the source, Luke.
PostPosted: Wed Aug 29, 2007 4:45 am 
Newbie

Joined: Tue Aug 28, 2007 12:54 pm
Posts: 16
Location: Munich, Germany
Well, I just went down the stacktrace, and as I wrote, in Environment,
line 529, I found what I pasted here.
You obviously need the source code for that, preferably integrated in
Eclipse or whatever your IDE is.

Please rate answers if they help solve your problem.

Cheers, Tom.

_________________
www.tomeicher.de


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.