Java hibernate中的HibernateFactory类将进入异常情况
当我们执行我们的项目时,它会转到Java hibernate中的HibernateFactory类将进入异常情况,java,web-services,hibernate,Java,Web Services,Hibernate,当我们执行我们的项目时,它会转到catch(异常e) 这是我的hibernate.cfg.xml文件 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration SYSTEM "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <
catch(异常e)
这是我的hibernate.cfg.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<!-- Assume test is the database name -->
<property name="hibernate.connection.url">
jdbc:mysql://localhost/gauizzapplication
</property>
<property name="hibernate.connection.username">
root
</property>
<property name="hibernate.connection.password">
root
</property>
<property name="show_sql">true</property>
<!-- List of XML mapping files -->
<mapping resource="hbm/UserMaster.hbm.xml"/>
</session-factory>
</hibernate-configuration>
问题似乎是
UserMaster.hbm.xml
不是好的xml,请尝试通过IDE验证器或xml在线验证工具运行它,例如,出于某些原因也可以查看一下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<!-- Assume test is the database name -->
<property name="hibernate.connection.url">
jdbc:mysql://localhost/gauizzapplication
</property>
<property name="hibernate.connection.username">
root
</property>
<property name="hibernate.connection.password">
root
</property>
<property name="show_sql">true</property>
<!-- List of XML mapping files -->
<mapping resource="hbm/UserMaster.hbm.xml"/>
</session-factory>
</hibernate-configuration>
org.hibernate.InvalidMappingException: Could not parse mapping document from resource hbm/UserMaster.hbm.xml