-->
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: NoClassDefFoundError while Creating the Session Factory
PostPosted: Tue Oct 03, 2006 11:11 am 
Beginner
Beginner

Joined: Tue Sep 20, 2005 11:01 am
Posts: 25
Hibernate version: 3.1.3

I am trying to get Hibernate up and running and have run into a problem.

While creating the Session Factory I get the error:

Code:
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
   at java.lang.Class.getConstructor0(Class.java:1930)
   at java.lang.Class.newInstance0(Class.java:278)
   at java.lang.Class.newInstance(Class.java:261)
   at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:327)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:219)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
   at gov.epa.owm.cwns.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:26)



To instanciate the Session Factory I use the following code:
Code:
public class HibernateUtil {
    private static Logger log = Logger.getLogger("gov.epa.owm.cwns.hibernate.HibernateUtil");

    private static final SessionFactory sessionFactory;

    static {
        try {
            // Create the SessionFactory
            sessionFactory = new Configuration().configure().buildSessionFactory();
        } catch (Throwable ex) {
            log.error("Initial SessionFactory creation failed.", ex);
            throw new ExceptionInInitializerError(ex);
        }
    }

    public static final ThreadLocal session = new ThreadLocal();



What Jar file should contain this class? Isn't the package net.sf from an older version of Hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 4:54 pm 
Regular
Regular

Joined: Tue Sep 26, 2006 11:37 am
Posts: 115
Location: Sacramento, CA
That class is from ehcache, http://ehcache.sourceforge.net/

Marius
--
If this helps, please rate :)


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.