-->
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.  [ 2 posts ] 
Author Message
 Post subject: failed.org.hibernate.MappingException
PostPosted: Mon Jun 26, 2006 8:15 am 
Beginner
Beginner

Joined: Thu Jun 22, 2006 8:56 am
Posts: 22
Hallo,

ich bekomme eine Exception Initial SessionFactory creation failed." bei:
Code:
public class HibernateSession {

    private static final SessionFactory sessionFactory;

    static {
        try {
            // Create the SessionFactory from hibernate.cfg.xml
           sessionFactory = new Configuration().configure().buildSessionFactory();
        }
        catch (Throwable ex) {
           
            System.err.println("Initial SessionFactory creation failed." + ex);
            throw new ExceptionInInitializerError(ex);
        }
    }

    public static SessionFactory getSessionFactory() {
        return HibernateSession.sessionFactory;
    }

}


Wodurch kann es verursacht werden?

Danke Euch ,

seven-12


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 29, 2006 6:58 am 
Newbie

Joined: Mon Apr 24, 2006 5:56 am
Posts: 7
Das liegt normalerweise nicht an deinem Java-Code, sondern an einem Fehler im XML-Mapping...

zB verwendest du ein <property name="irgendwas"/> obwohl es in der gemappten Klasse gar keine property "irgendwas" gibt...

also ich tippe mal ganz einfach auf Tippfehler... im obigen fall müsste dann irgendwo im Stacktrace der Exception so irgendetwas stehen wie "cannot find property 'irgendwas'"... vielleicht ist deine XML-File auch nicht mal valide... dann ist irgendwo im XML ne SaxExceptin versteckt...

also einfach mal Stacktrace genauer anschauen oder hier posen... ;)


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