休眠配置文件不正确? [英] Hibernate config file is incorrect?

查看:75
本文介绍了休眠配置文件不正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早期帖子中,我的休眠配置文件包含一些未知的问题.一个人给了我另一个配置文件以使用,它解决了旧的配置错误.但是它也引入了一个新的错误,如下所示.我该如何解决?

In an earlier post, my hibernate config file had some unknown problem. One person gave me another config file to use and that resolved the old config error. But it also introduced a new error which is given below. How do I fix it ?

编辑

org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.3.1.GA
[main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
[main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[main] INFO org.hibernate.cfg.Configuration - configuring from resource:
 /hibernate.cfg.xml
[main] INFO org.hibernate.cfg.Configuration - Configuration resource: 
/hibernate.cfg.xml
[main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : 
com/xx  /portal/db/User.hbm.xml
Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com/xx
/portal/db/User.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:610)
at org.hibernate.cfg.AnnotationConfiguration.addResource
(AnnotationConfiguration.java:912)
at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement
(AnnotationConfiguration.java:617)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure
(AnnotationConfiguration.java:1002)
at    org.hibernate.cfg.AnnotationConfiguration.doConfigure
(AnnotationConfiguration.java:69)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure
(AnnotationConfiguration.java:990)
at org.hibernate.cfg.AnnotationConfiguration.doConfigure
(AnnotationConfiguration.java:69)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.AnnotationConfiguration.configure
(AnnotationConfiguration.java:972)
at org.hibernate.cfg.AnnotationConfiguration.configure
(AnnotationConfiguration.java:69)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at org.hibernate.cfg.AnnotationConfiguration.configure
(AnnotationConfiguration.java:966)
at com.examscam.model.User.persist(User.java:45)
at com.examscam.model.User.main(User.java:55) 

我删除了!-禁用缓存-"!-数据库的UTF8-"!-实体映射-",现在我得到了一个新错误.

推荐答案

如果您没有任何实体映射文件,请先删除<mapping resource="com/xx/portal/db/User.hbm.xml" />行.

Just remove the line <mapping resource="com/xx/portal/db/User.hbm.xml" /> firstly if you don't have any entity mapping file.

这篇关于休眠配置文件不正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆