首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

org.hibernate.MappingNotFoundException: resource: net.itaem.bean/HomeNews.hbm.xm

2013-04-20 
org.hibernate.MappingNotFoundException: resource: net.itaem.bean/HomeNews.hbm.xm?xml version1.0

org.hibernate.MappingNotFoundException: resource: net.itaem.bean/HomeNews.hbm.xm
<?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">
  <hibernate-configuration>
  <session-factory>
  <!--Examda提示:数据库用户名-->
  <property name="connection.username">root</property>
  <!--数据库URL-->
  <property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/news_wire
</property>
<property name="dialect">
org.hibernate.dialect.MySQLInnoDBDialect
</property>
<property name="connection.username">
itaem
</property>
<property name="connection.password">
imitaem
</property>
<property name="show_sql">
false
</property>

  <mapping resource="bean/HomeNews.hbm.xml" />
  </session-factory>
  </hibernate-configuration> hibernate
[解决办法]


<mapping resource="net/itaem/bean/HomeNews.hbm.xml"/>

hibernate配置文件里面这样写试下
[解决办法]
config.addClass(HomeNews.class);
sessionFactory = config.buildSessionFactory();
是不是加载重复了,配置文件中有HomeNews,又重新编码加入。 试试删除上一句代码

热点排行