-->
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: Building SessionFactory failed under Hibernate 3.2.0cr2
PostPosted: Wed May 10, 2006 5:31 am 
Newbie

Joined: Sun Sep 11, 2005 7:46 pm
Posts: 15
Hi folks,

my application ran well with Hibernate 3.1 RC3. Today I swapped 3 jar files in the lib folder (they are hibernate3.jar, antlr2.7.5h3 --> antlr2.7.6, ehcache-1.1 --> ehcache-1.2), the application broke down with such exceptions:

11:07:56,175 ERROR HibernateUtil:56 - Building SessionFactory failed.
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:346)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:220)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at test.HibernateUtil.<clinit>(HibernateUtil.java:50)
at test.UmfrageOMTest.<clinit>(UmfrageOMTest.java:20)

at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:220)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at test.HibernateUtil.<clinit>(HibernateUtil.java:50)


Here is the relevant code in my HibernateUtil.java:

Code:
static {
      try {
         configuration = new Configuration();
         sessionFactory = configuration.configure().buildSessionFactory();
         // We could also let Hibernate bind it to JNDI:
         // configuration.configure().buildSessionFactory()
      } catch (Throwable ex) {
         // We have to catch Throwable, otherwise we will miss
         // NoClassDefFoundError and other subclasses of Error
         log.error("Building SessionFactory failed.", ex);
         throw new ExceptionInInitializerError(ex);
      }
   }


I don't understand why it worked under Hibernate 3.1 rc 3 but broken down with the Hibernate 3.2.0 cr 2. Is there any change need to do in my configuration file? Here is the relevant code:
Code:
<hibernate-configuration> 
  <session-factory>
     
    <!-- Database connection settings -->
      <property name="hibernate.connection.driver_class">
         com.sap.dbtech.jdbc.DriverSapDB
      </property>
      <property name="hibernate.connection.url">
         jdbc:sapdb://...
      </property>
      <property name="hibernate.connection.username">
         ...
      </property>
      <property name="hibernate.connection.password">...</property>
      
   

    <!-- SQL dialect  -->
      <property name="hibernate.dialect">
         org.hibernate.dialect.SAPDBDialect
      </property>
    <!-- Echo all executed SQL to stdout -->
      <property name="show_sql">true</property>

    <property name="hibernate.connection.release_mode">
      auto
    </property>

      <!-- Die Pfade zu den Mapping Dateien -->
      <mapping resource="..." />
   ...
      
  </session-factory>
 
</hibernate-configuration>



or did I miss any necessary jar file in the lib folder?

Any enlightenment would be highly appreciated! Many thanks in advance!


Regards,
Ellen


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 9:58 am 
Expert
Expert

Joined: Tue Apr 25, 2006 12:04 pm
Posts: 260
You can check if the class in this exception message
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
is available in your ehcache-1.2.jar and it is in your classpath.


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.