我有如下的休眠配置文件
en<?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.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.password">postgres</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/mining</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.current_session_context_class">thread</property>
<mapping file="WEB-INF/mams-hibern.xml"></mapping>
</session-factory>
</hibernate-configuration>
但是我有例外
org.hibernate.MappingNotFoundException: file: WEB-INF\mams-hibern.xml not found
cfg文件位于
project>src>hiber.cfg.xml
mams-hibern.xml包含映射位于文件夹中
project>WebContent>WEB-INF>mams-hibern.xml
有什么解决方案。有人知道请帮助我
如果您使用的是类似eclipse的ID,请将您的hbm文件project>src>mams-hibern.xml
放入cfg文件中,只需使用
<mapping resource="mams-hibern.xml"/>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句