欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

报错: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>
相关标签: 笔记 java