absolute file path because it does not reside in the file system"/>
maven构建 出错:cannot be resolved to absolute file path because it does not reside in the file system
问题总结:使用maven分模块组件项目的时候,domain中的实体的*.hbm.xml文件不能被spring扫描到,因为聚合的时候核心包已经达成jar包了,所以要去jar中去找hbm.xml文件
<bean name="sessionFactory"class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"><property name="dataSource" ref="dataSource" /><property name="hibernateProperties"><props><prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop><!-- 可选配置 --><prop key="hibernate.show_sql">false</prop><prop key="hibernate.format_sql">true</prop><prop key="hibernate.hbm2ddl.auto">update</prop><prop key="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</prop></props></property><!-- 引入orm元数据,指定orm元数据所在的包路径,spring会自动读取包中的所有配置 --><!-- <property name="mappingDirectoryLocations" value="classpath:com/jason/domain/" /> --><!-- 应该用以下方式代替 --><property name="mappingJarLocations"><list><value>WEB-INF/lib/clicli_core-0.0.1-SNAPSHOT.jar</value></list></property>
</bean>
更多推荐
maven构建 出错:cannot be resolved to absolute file path because it does not reside i
发布评论