Java org.hibernate.InvalidMappingException:无法从资源解析映射文档

Java org.hibernate.InvalidMappingException:无法从资源解析映射文档,java,hibernate,Java,Hibernate,我将代码中的映射从xml资源切换到注释,并得到了该异常。我看不出有什么错误。我想你可以从我的代码中找到答案: hibernate.cfg.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hib

我将代码中的映射从xml资源切换到注释,并得到了该异常。我看不出有什么错误。我想你可以从我的代码中找到答案:

hibernate.cfg.xml

<?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>
    <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
    <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
    <property name="hibernate.connection.url">####</property>
    <property name="hibernate.connection.username">##</property>
    <property name="hibernate.connection.password">###</property>
    <property name="hibernate.current_session_context_class">thread</property>
    <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
    <property name="hibernate.show_sql">true</property>
    <mapping class="max.Trade" file="" jar="" package="max" resource=""/>
  </session-factory>
</hibernate-configuration>
我真的很感激任何帮助


谢谢

将映射定义标记替换为

<mapping class="max.Trade"/>
<mapping class="max.Trade"/>