神啊救救我吧 !!!!

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.MappingException: Could not read mappings from resource: com/hbca/hibernate/vo/Customers.hbm.xml
 at org.hibernate.cfg.Configuration.addClass(Configuration.java:506)
 at com.hbca.hibernate.biz.BussinessService.<clinit>(BussinessService.java:20)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.hbca.hibernate.vo.Customers
 at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
 at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:154)
 at org.hibernate.cfg.Configuration.add(Configuration.java:386)
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
 at org.hibernate.cfg.Configuration.addClass(Configuration.java:503)
 ... 1 more
 

配置文件

 

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

 <session-factory>
  <property name="connection.username">sa</property>
  <property name="connection.url">
   jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=maple
  </property>
  <property name="dialect">
   org.hibernate.dialect.SQLServerDialect
  </property>
  <property name="myeclipse.connection.profile">maple</property>
  <property name="connection.password">123</property>
  <property name="connection.driver_class">
   com.microsoft.jdbc.sqlserver.SQLServerDriver
  </property>
  <property name="jdbc.fetch_size">5</property>
  <property name="show_sql">true</property>
  <mapping resource="com/hbca/hibernate/vo/Customers.hbm.xml" />
 </session-factory>

</hibernate-configuration>

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

参与评论 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页

打赏作者

love_alizee

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值