org.hibernate.MappingException: entity class not found

来源:互联网 发布:凤凰金融 以大数据 编辑:程序博客网 时间:2024/05/20 04:49
  org.hibernate.MappingException: entity class not found 

1、检查配置文件路径是否正确

<property name="mappingDirectoryLocations">
<list>
<value>classpath:com/ssh/bo</value>
</list>
</property>



2、可能原因:若持久化类为:User.java 

                   对应的hibernate映射文件为:User.hbm.xml 

                  一般系统自动生成的映射文件为: 

                        <hibernate-mapping> 

                                  <class name="User" table="...... 
                                    ....... 
                       </hibernate-mapping> 

                  要将class路径改为绝对路径。若User.java在包com.ssh.bean 

                 则要改为<class name="com.ssh.bean.User" ......>


0 0
原创粉丝点击