【发布时间】:2011-08-19 17:00:08
【问题描述】:
我的 hibernate.cfg.xml 中的映射资源有问题 - 我明白了
Element type "mapping-resource" must be followed by either attribute specifications, ">" or "/>".'
我的 hibernate.cfg.xml 看起来像
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="datasourceName">java:jboss/datasources/MySqlDS</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping-resource="com/mycompany/myapp/common/businessobjects/User.hbm.xml"/>
<mapping-resource="com/mycompany/myapp/common/businessobjects/Company.hbm.xml"/>
<mapping- resource="com/mycompany/myapp/common/businessobjects/ServerSettings.hbm.xml"/>
<mapping-resource="com/mycompany/myapp/common/businessobjects/Station.hbm.xml"/>
</session-factory>
</hibernate-configuration>
不确定是什么问题?语法似乎正确?我将我的地图资源资料基于此处的信息
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html
【问题讨论】:
-
大概
mapping-____resource中的大空白是在您复制 XML 时发生的?