为什么无法通过classpath *:** / * Mapper.xml检索jar文件?
SqlSessionFactoryBean日志
public void setMapperLocations(Resource[] mapperLocations) {
for (Resource resource : mapperLocations) {
log.debug("mapperLocations : {}", resource);
}
super.setMapperLocations(mapperLocations);
this.mapperLocations = mapperLocations;
}
context-datasource.xml
<bean id="example.sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean">
..
<property name="mapperLocations" value="classpath*:**/*Mapper.xml" />
</bean>
结果
mapperLocations : file [C:\project-KRISS\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\web.krisstar\WEB-INF\classes\kr\re\kriss\portal\requstCntrmsrCnter\service\impl\RequstCntrmsrCnterMapper.xml]
...
context-datasource.xml
<bean id="example.sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean">
..
<property name="mapperLocations">
<list>
<value>classpath*:/egovframework/com/**/*Mapper.xml</value>
<value>classpath*:/egovframework/guide/**/*Mapper.xml</value>
<value>classpath*:/egovframework/sample/**/*Mapper.xml</value>
<value>classpath*:/kr/re/kriss/**/*Mapper.xml</value>
</list>
</property>
</bean>
结果
mapperLocations : file [C:\project-KRISS\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\web.krisstar\WEB-INF\classes\kr\re\kriss\portal\requstCntrmsrCnter\service\impl\RequstCntrmsrCnterMapper.xml]
mapperLocations : URL [jar:file:/C:/project-KRISS/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp4/wtpwebapps/web.krisstar/WEB-INF/lib/core.scheduler-1.0.0.jar!/kr/re/kriss/com/message/service/impl/PropertiesManageMapper.xml]
...
您在设置mapperLocations时遇到问题吗?