Could not parse mapping document from file F:\dev\workspacesldgxzxd\framework\webroot\WEB-INF\conf\y

接下来我要放出另头疼的异常


 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'varUserDeleteListener' defined in ServletContext resource [/WEB-INF/conf/techcomp/variability/applicationContext-variability.xml]: Cannot resolve reference to bean 'cacheSynchronizeManager' while setting bean property 'cacheSynchronizeManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheSynchronizeManager' defined in ServletContext resource [/WEB-INF/conf/techcomp/cache/applicationContext.xml]: Cannot resolve reference to bean 'cache_cacheObjectTimestampDAO_dao' while setting bean property 'cacheTimestampDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cache_cacheObjectTimestampDAO_dao' defined in ServletContext resource [/WEB-INF/conf/techcomp/cache/applicationContext-dao.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/conf/platform/core/applicationContext-datasource.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from file F:\dev\workspacesldgxzxd\framework\webroot\WEB-INF\conf\ynLaborRelationShip\approvalBusinessManager\hbm\viewOfficeServices.hbm.xml

前面这么多,最重要的就是最后一句。我的一个hibernate的实体类的配置文件解析异常,映射不到。项目运行的时候就会抛这样的异常。经过我研究其他没有报错的*.hbm.xml的配置文件,我发现的实体类没有设置id。

解决办法,将下面注视显示的bean替换成<id></id>

 <!-- the type 'RAW' could not be resolved.. defaulting to java.lang.String --><!--
    <property name="officeId" label="OFFICE_ID" type="java.lang.String" getStrategy="public" setStrategy="public">
      <column name="OFFICE_ID" not-null="false" length="16" />
      <constraint>
        <length max="16" />
      </constraint>
    </property>
    -->
      <id name="officeId" type="string" getStrategy="public" setStrategy="public">
         <column name="OFFICE_ID" length="16" />
         <generator class="uuid" />
      </id>

成功运行!!!





猜你喜欢

转载自blog.csdn.net/zhangludcsdn/article/details/79553566