-->
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.  [ 6 posts ] 
Author Message
 Post subject: java.lang.ExceptionInInitializerError
PostPosted: Wed Dec 03, 2003 12:31 pm 
Newbie

Joined: Wed Nov 19, 2003 7:53 am
Posts: 6
Location: London
java.lang.ExceptionInInitializerError occurs when the following line executes:

sessionFactory = new Configuration().configure().buildSessionFactory();

I have the hibernate.cfg.xml file in the correct location. And I am certain the fields are mapped correctly.

Here is the mapping (only 1 field for now!!)

Code:
+--------+---------+------+-----+---------+----------------+
| Field  | Type    | Null | Key | Default | Extra          |
+--------+---------+------+-----+---------+----------------+
| newsid | int(11) |      | PRI | NULL    | auto_increment |
+--------+---------+------+-----+---------+----------------+


NewsVO.hbm.xml
------------------------------------------------------------
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
    <class name="clinton.inet.news.NewsVO" table="news">       
        <id name="newsId" type="int">
            <column name="newsid" sql-type="int"/>
            <generator class="hilo"/>
        </id>   
    </class>
</hibernate-mapping>

Can anyone spot anything wrong going on here..

Thanks in advance
James
Code:


Top
 Profile  
 
 Post subject: No properties?
PostPosted: Wed Dec 03, 2003 2:10 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
I think you need to actually have at least one property on your class that is mapped besides the id/key.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 8:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Why do you even both posting an exception without the full stack trace?

David: no, you don't need to map a property.


Top
 Profile  
 
 Post subject: Kindness costs nothing.
PostPosted: Thu Dec 04, 2003 5:31 am 
Newbie

Joined: Wed Nov 19, 2003 7:53 am
Posts: 6
Location: London
Fixed problem. Missing *ing jar file.

Will add stacks in future. Reason for not doing it was:

* I had hoped someone would recognise the exception without them.
* The stack was about 100 lines and if someone was that interested then they would probably *kindly* request them.

Or maybe not in this case.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 04, 2003 6:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Well, in future you will know to "kindly" add enough information to be able to resolve your problem, as is requested in the instructions for using this forum. Otherwise you waste the time of everyone who must read your post and request the information that you could have chosen to give the first time.


Top
 Profile  
 
 Post subject: Friends forever.
PostPosted: Thu Dec 04, 2003 6:59 am 
Newbie

Joined: Wed Nov 19, 2003 7:53 am
Posts: 6
Location: London
Thanks for your comments Gavin.
You've been very helpful.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.