Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at org.hibernate.impl.SessionFactoryImpl.buildCurrentSessionContext(SessionFactoryImpl.java:1036)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:366)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.yin.hibernate.model.GuestBookTest.main(GuestBookTest.java:10)
解决方法:
引入hibernate的jar包:jta.jar
at org.hibernate.impl.SessionFactoryImpl.buildCurrentSessionContext(SessionFactoryImpl.java:1036)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:366)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.yin.hibernate.model.GuestBookTest.main(GuestBookTest.java:10)
解决方法:
引入hibernate的jar包:jta.jar