-->
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: javax/transaction/Synchronization
PostPosted: Mon Dec 22, 2003 3:24 am 
Beginner
Beginner

Joined: Sun Dec 21, 2003 11:19 pm
Posts: 22
Location: Kentucky, USA
disclaimer: I am new to both java and Hibernate ;)

I have a simplistic sample below that fails with a java.lang.NoClassDefFoundError: javax/transaction/Synchronization on openSession(). Based on searching sun.com, I know that the Synchronization class is part of the EE version but am fairly certain that SE is all that is required to run Hibernate.

Any suggestions or pointers to help would be greatly appreciated.
Timothy Vogel

Code:
public static void main(String[] args) {
   TaClassb curClass = null;
   SessionFactory sessions;
   Session curSess = null;

   try {
      curClass = new TaClassb("first class", "comment", 0);

      sessions = new Configuration().configure("/hibernate.cfg.xml").buildSessionFactory();
      curSess = sessions.openSession();

      curSess.save(curClass);
      curClass = null;
      curSess.close();
   } catch (HibernateException e) {
      System.out.println("Error thrown during save [" + e.getMessage() + "]");
      
   }
}



hibernate.cfg.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
   <!-- a SessionFactory instance -->
   <session-factory>
      <!-- properties -->
      <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
      <property name="connection.url">jdbc:hsqldb:data/TeachersAid</property>
      <property name="connection.username">sa</property>
      <property name="connection.password"></property>
      <property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property>
      <property name="show_sql">true</property>
      <property name="hibernate.cache.provider_class">net.sf.hibernate.cache.HashtableCacheProvider</property>
      <property name="use_outer_join">true</property>
<!-- same results w/ & w/o this property
      <property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
-->
      <!-- mapping files -->
      <mapping resource="src/java/com/ccsi/TeachersAid/common/TaClassb.hbm.xml" />
   </session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 22, 2003 3:29 am 
Beginner
Beginner

Joined: Sun Dec 21, 2003 11:19 pm
Posts: 22
Location: Kentucky, USA
OK ... I apologize for contributing to the noise ratio ... my answer is in thread http://forum.hibernate.org/viewtopic.php?t=926591

Tim (red faced) Vogel


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.