如何用Application测试Hibernate(解决马上给分50)
日期:2006-08-23 荐:
如何用Application测试Hibernate(解决马上给分50)一个很简单的测试程序:public class ConnTest {public static void main(String[] args) {try{SessionFactory sf=new Configuration().configure().buildSessionFactory();Session session=sf.openSession();Transaction ts=session.beginTransaction();ts.commit();session.close();}catch(Exception e){System.out.print(e.getMessage());}}}我也加了commons-logging-1.0.4.jar那个包,可是还是会报以下的错:java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactoryat net.sf.hibernate.cfg.Configuration.<clinit>(Configuration.java:95)at com.hibernate.test.ConnTest.main(ConnTest.java:26)Exception in thread "main" 希望哪位高手能解答一下!创建类错误再检查你的程序
标签: