zzeng

zzeng

hibernate配置

1.在Eclipse里面的Tomcat的Classpath要配置对
2.当DB的Table的PK是数字的时候,在Hibernate里面的PK类型才能是Increase
小弟看了网上的hibernate教程后,
http://218.30.21.73/qicai/Info_Show.asp?ArticleID=279
做 了一下,当做到最后一步run时,报了找不到hibernate.cfg.xml和user.hbm文件,当我把两个文件丛包中移动出来时又报 net.sf.hibernate.MappingException: could not instantiate id generator
at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:82)
at net.sf.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:80)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:631)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:715)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
at com.base._BaseRootDAO.initialize(_BaseRootDAO.java:54)
at com.base._BaseRootDAO.initialize(_BaseRootDAO.java:38)
at com.dao.UserDAO.main(UserDAO.java:17)
Caused by: java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:86)
at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:76)
... 9 more
谁有详细的Hibernate访问数据库的教程,给我个谢谢了,或者告诉我怎么这样的问题!
---->
ID主键类型不对



3.把jta.jar包加进来!emotion
--->
Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/Synchronization

posted on 2005-09-28 14:31 zzeng 阅读(311) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: