| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2435 人关注过本帖
标题:myeclipse2013 为何搭建不了 hibernate 4 整天报错 我已依照书本做 求简单例 ...
只看楼主 加入收藏
chenyiqing23
Rank: 2
等 级:论坛游民
帖 子:84
专家分:53
注 册:2007-12-27
结帖率:73.33%
收藏
已结贴  问题点数:50 回复次数:2 
myeclipse2013 为何搭建不了 hibernate 4 整天报错 我已依照书本做 求简单例子
求解一个 myeclipse2013 搭建 hibernater
简单例子
希望有图解
搜索更多相关主题的帖子: hibernate 
2013-08-22 23:26
yuccn
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:何方
等 级:版主
威 望:167
帖 子:6815
专家分:42393
注 册:2010-12-16
收藏
得分:35 
什么错误?

我行我乐
公众号:逻辑客栈
我的博客:
https://blog.yuccn. net
2013-08-23 16:43
chenyiqing23
Rank: 2
等 级:论坛游民
帖 子:84
专家分:53
注 册:2007-12-27
收藏
得分:0 
回复 2楼 yuccn
2013-8-23 20:22:50 org.hibernate. <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
2013-8-23 20:22:50 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.4.Final}
2013-8-23 20:22:50 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
2013-8-23 20:22:50 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
2013-8-23 20:22:50 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
2013-8-23 20:22:50 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
2013-8-23 20:22:50 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: orm/Userinfo.hbm.xml
2013-8-23 20:22:50 org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
2013-8-23 20:22:50 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
2013-8-23 20:22:50 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
2013-8-23 20:22:50 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
2013-8-23 20:22:50 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] at URL [jdbc:sqlserver://localhost:1433;DatabaseName=struts2]
2013-8-23 20:22:50 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=sa, password=****}
2013-8-23 20:22:51 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
2013-8-23 20:22:51 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
2013-8-23 20:22:51 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
2013-8-23 20:22:51 org.hibernate.validator.util.Version <clinit>
信息: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
2013-8-23 20:22:51 org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
信息: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
2013-8-23 20:22:51 org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
信息: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: Could not instantiate id generator [entity-name=orm.Userinfo]
    at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:123)
    at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:192)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:317)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1744)
    at db.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:34)
    at orm.BaseHibernateDAO.getSession(BaseHibernateDAO.java:14)
    at db.Check.main(Check.java:18)
Caused by: org.hibernate.MappingException: org.hibernate.dialect.SQLServerDialect does not support sequences
    at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:791)
    at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:111)
    at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:117)
    ... 6 more
2013-8-23 20:22:51 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
2013-8-23 20:22:51 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
2013-8-23 20:22:51 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: orm/Userinfo.hbm.xml
2013-8-23 20:22:51 org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
2013-8-23 20:22:51 org.hibernate.cfg.Configuration$MappingsImpl addImport
INFO: HHH000071: Duplicate import: orm.Userinfo -> orm.Userinfo
2013-8-23 20:22:51 org.hibernate.cfg.Configuration$MappingsImpl addImport
INFO: HHH000071: Duplicate import: orm.Userinfo -> Userinfo
%%%% Error Creating SessionFactory %%%%
org.hibernate.InvalidMappingException: Could not parse mapping document from resource orm/Userinfo.hbm.xml
    at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3409)
    at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXmlQueue(Configuration.java:3398)
    at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3386)
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1341)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1731)
    at db.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:73)
    at db.HibernateSessionFactory.getSession(HibernateSessionFactory.java:55)
    at orm.BaseHibernateDAO.getSession(BaseHibernateDAO.java:14)
    at db.Check.main(Check.java:18)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping orm.Userinfo
    at org.hibernate.cfg.Configuration$MappingsImpl.addClass(Configuration.java:2574)
    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:172)
    at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3406)
    ... 8 more
Exception in thread "main" java.lang.NullPointerException
    at db.Check.main(Check.java:18)
2013-08-23 20:24
快速回复:myeclipse2013 为何搭建不了 hibernate 4 整天报错 我已依照书本做 求 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016097 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved