| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2864 人关注过本帖
标题:myeclipse2013 hibernate 报错 帮忙纠错
只看楼主 加入收藏
chenyiqing23
Rank: 2
等 级:论坛游民
帖 子:84
专家分:53
注 册:2007-12-27
结帖率:73.33%
收藏
已结贴  问题点数:10 回复次数:3 
myeclipse2013 hibernate 报错 帮忙纠错
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)
搜索更多相关主题的帖子: hibernate 
2013-08-23 20:26
hhwz
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:87
帖 子:687
专家分:4502
注 册:2011-5-22
收藏
得分:3 
Userinfo.hbm.xml找不到这个文件
2013-08-24 06:14
chenyiqing23
Rank: 2
等 级:论坛游民
帖 子:84
专家分:53
注 册:2007-12-27
收藏
得分:0 
回复 2楼 hhwz
那怎样修改好呢???
2013-08-24 15:06
hhwz
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:87
帖 子:687
专家分:4502
注 册:2011-5-22
收藏
得分:7 
这个是hibernate是映射文件啊 添加上不就好了
2013-08-24 18:26
快速回复:myeclipse2013 hibernate 报错 帮忙纠错
数据加载中...
 
   



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

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