报错:Could not resolve resource location pattern [classpath:org/per/yyc/mapping/*.xml]: class path res
程序员文章站
2022-04-12 17:46:25
...
报错:Could not resolve resource location pattern [classpath:org/per/yyc/mapping/*.xml]: class path res
大概意思就是扫描不到[classpath:org/per/yyc/mapping/*.xml]
classpath
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 数据库连接池 -->
<property name="dataSource" ref="dataSource" />
<!-- 自动扫描mapping.xml文件 -->
<property name="mapperLocations" value="classpath:org/per/yyc/mapping/*.xml"></property>
</bean>
修改之后classpath*
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 数据库连接池 -->
<property name="dataSource" ref="dataSource" />
<!-- 自动扫描mapping.xml文件 -->
<property name="mapperLocations" value="classpath*:org/per/yyc/mapping/*.xml"></property>
</bean>