spring 和mybatis整合时 使用context:property-placeholder载不进属性 还报org.springframework.beans.factory.BeanCrea

本文介绍Spring与MyBatis整合时可能出现的配置错误及解决方法,重点在于正确配置SqlSessionFactory与MapperScannerConfigurer,避免PropertyPlaceholderConfigurer失效的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在spring核心配置文件(applicationContext.xml)中配置

<!-- 加载数据库连接信息的properties文件 -->
<context:property-placeholder location="classpath:db.properties"/>
<!-- 使用第三方的数据库连接池dbcp -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"></property>
<property name="url" value="${jdbc.url}"></property>
<property name="username" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
<!-- 开发阶段数据库最大的连接建议设置小一点    可设置3个 -->
<property name="maxActive" value="${jdbc.maxActive}"></property>
<property name="maxIdle" value="${jdbc.maxIdle}"></property>
</bean>


<!-- 配置SqlSessionFactory -->
<bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 注入数据源 -->
<property name="dataSource" ref="dataSource"></property>

<!-- 配置SqlMapConfig.xml文件 -->
<property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml"></property>
</bean>


<!--使用mybatis自动扫描mapper接口  代码如下-->

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 会话工厂 -->
<property name="sqlSessionFactory" ref="sqlSessionFactoryBean"></property>

<!-- 扫描包路径   多个包中间使用半角逗号分隔 -->
<property name="basePackage" value="cn.xing.ssm.dao.mapper"></property>
</bean>

问题:在spring 和mybatis组合时 使用该配置方式会报异常

异常为:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined inclass path resource [spring/applicationContext-dao.xml]: Cannot resolve reference to bean 'sqlSessionFactoryBean' while setting bean property'sqlSessionFactoryBeanName'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name'sqlSessionFactoryBean' defined in class path resource [spring/applicationContext-dao.xml]: Cannot resolve reference to bean 'dataSource' while setting beanproperty 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined inclass path resource [spring/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failedto convert property value of type 'java.lang.String' to required type 'int' for property 'maxActive'; nested exception is java.lang.NumberFormatException: For inputstring: "${jdbc.maxActive}"

问题分析

在spring里使用org.mybatis.spring.mapper.MapperScannerConfigurer 进行自动扫描的时候,设置了sqlSessionFactory 的话,可能会导致PropertyPlaceholderConfigurer失效,也就是用${jdbc.username}这样之类的表达式,将无法获取到properties文件里的内容。 导致这一原因是因为,MapperScannerConigurer实际是在解析加载bean定义阶段的,这个时候要是设置sqlSessionFactory的话,会导致提前初始化 一些类,这个时候,PropertyPlaceholderConfigurer还没来得及替换定义中的变量,导致把表达式当作字符串复制了。 但如果不设置sqlSessionFactory 属性的话,就必须要保证sessionFactory在spring中名称一定要是sqlSessionFactory ,否则就无法自动注入。又或者直接定 义 MapperFactoryBean ,再或者放弃自动代理接口方式。

解决方法: 

改用sqlSessionFactoryBeanName注入就没有问题(不要使用sqlSessionFactory属性注入,使用sqlSessionFactoryBeanName注入),因为这时不会立即初始化sqlSessionFactory,传入的只是名字(即:将 ref="sqlSessionFactoryBean" 配置改成 value="sqlSessionFactoryBean"),非bean,所以不会引发提前初始化问题。
代码实现:

<!-- 加载数据库连接信息的properties文件 -->
<context:property-placeholder location="classpath:db.properties"/>
<!-- 使用第三方的数据库连接池dbcp -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"></property>
<property name="url" value="${jdbc.url}"></property>
<property name="username" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
<!-- 开发阶段数据库最大的连接建议设置小一点    可设置3个 -->
<property name="maxActive" value="${jdbc.maxActive}"></property>
<property name="maxIdle" value="${jdbc.maxIdle}"></property>
</bean>

<!-- 配置SqlSessionFactory -->
<bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 注入数据源 -->
<property name="dataSource" ref="dataSource"></property>

<!-- 配置SqlMapConfig.xml文件 -->
<property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml"></property>
</bean>


<!--使用mybatis自动扫描mapper接口  代码如下-->

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 会话工厂 -->
<property name="sqlSessionFactory" value="sqlSessionFactoryBean"></property>

<!-- 扫描包路径   多个包中间使用半角逗号分隔 -->
<property name="basePackage" value="cn.xing.ssm.dao.mapper"></property>
</bean>

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <!--<context:component-scan base-package="com.tjise.bean"/>--> <!--数据库连接信息的属性文件 --> <context:property-placeholder location="classpath:jdbc-config.properties"/> <!-- 配置Druid数据源的Bean --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> <property name="driverClassName" value="${jdbc.driver}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> <!-- 配置SessionFactory的Bean --> <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <!-- 注入数据源 --> <property name="dataSource" ref="dataSource"/> <!-- 指定MyBatis配置文件的位置 --> <property name="configLocation" value="classpath:mybatis.xml"/> <!-- 给实体类起别名 --> <property name="typeAliasesPackage" value="com.tjise.entity"/> </bean> <!-- 配置mapper接口的扫描器,将Mapper接口的实现类自动注入到IoC容器中 实现类Bean的名称默认为接口类名的首字母小写 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <!-- basePackage属性指定自动扫描mapper接口所在的包 --> <property name="basePackage" value="com.tjise.mapper"/> </bean> </beans>
03-23
2025-06-09T22:03:14.229+08:00 INFO 1 --- [ruoyi-archives] [ main] d.s.b.c.e.WelcomeLogoApplicationListener : [DUBBO] :: Dubbo (v3.2.14) : https://github.com/apache/dubbo :: Discuss group : dev@dubbo.apache.org , dubbo version: 3.2.14, current host: 172.17.0.11 Spring Boot Version: 3.2.9 Spring Application Name: ruoyi-archives _ _ | | (_) __ _ _ __ ___| |__ ___ _____ ___ / _` | '__/ __| '_ \| \ \ / / _ \/ __| | (_| | | | (__| | | | |\ V / __/\__ \ \__,_|_| \___|_| |_|_| \_/ \___||___/ 2025-06-09T22:03:14.400+08:00 INFO 1 --- [ruoyi-archives] [ main] o.d.archives.RuoYiArchivesApplication : Starting RuoYiArchivesApplication using Java 17.0.15 with PID 1 (/ruoyi-archives.jar started by root in /) 2025-06-09T22:03:14.401+08:00 INFO 1 --- [ruoyi-archives] [ main] o.d.archives.RuoYiArchivesApplication : The following 1 profile is active: "prod" 2025-06-09T22:03:14.484+08:00 WARN 1 --- [ruoyi-archives] [ main] c.a.c.n.c.NacosConfigDataLoader : [Nacos Config] config[dataId=ruoyi-archives.yml, group=DEFAULT_GROUP] is empty 2025-06-09T22:03:14.484+08:00 WARN 1 --- [ruoyi-archives] [ main] c.a.c.n.c.NacosConfigDataLoader : [Nacos Config] config[dataId=datasource.yml, group=DEFAULT_GROUP] is empty 2025-06-09T22:03:14.484+08:00 WARN 1 --- [ruoyi-archives] [ main] c.a.c.n.c.NacosConfigDataLoader : [Nacos Config] config[dataId=application-common.yml, group=DEFAULT_GROUP] is empty 2025-06-09T22:03:16.045+08:00 INFO 1 --- [ruoyi-archives] [ main] o.apache.dubbo.rpc.model.FrameworkModel : [DUBBO] Dubbo Framework[1] is created, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.061+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.r.GlobalResourcesRepository : [DUBBO] Creating global shared handler ..., dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.160+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.dubbo.rpc.model.ApplicationModel : [DUBBO] Dubbo Application[1.0](unknown) is created, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.162+08:00 INFO 1 --- [ruoyi-archives] [ main] org.apache.dubbo.rpc.model.ScopeModel : [DUBBO] Dubbo Module[1.0.0] is created, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.202+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.context.AbstractConfigManager : [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.203+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.context.AbstractConfigManager : [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.221+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.utils.SerializeSecurityManager : [DUBBO] Serialize check serializable: true, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.222+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize allow list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-3.2.14.jar!/security/serialize.allowlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.249+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize allow list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-common-3.2.14.jar!/security/serialize.allowlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.250+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize blocked list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-3.2.14.jar!/security/serialize.blockedlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.294+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize blocked list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-common-3.2.14.jar!/security/serialize.blockedlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.417+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.dubbo.rpc.model.ApplicationModel : [DUBBO] Dubbo Application[1.1](unknown) is created, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.418+08:00 INFO 1 --- [ruoyi-archives] [ main] org.apache.dubbo.rpc.model.ScopeModel : [DUBBO] Dubbo Module[1.1.0] is created, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.432+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.context.AbstractConfigManager : [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.432+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.context.AbstractConfigManager : [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.440+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize allow list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-3.2.14.jar!/security/serialize.allowlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.440+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize allow list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-common-3.2.14.jar!/security/serialize.allowlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.440+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize blocked list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-3.2.14.jar!/security/serialize.blockedlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.441+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize blocked list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-common-3.2.14.jar!/security/serialize.blockedlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.463+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.s.c.DubboSpringInitializer : [DUBBO] Use default application: Dubbo Application[1.1](unknown), dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.463+08:00 INFO 1 --- [ruoyi-archives] [ main] org.apache.dubbo.rpc.model.ScopeModel : [DUBBO] Dubbo Module[1.1.1] is created, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.471+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.context.AbstractConfigManager : [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.476+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize allow list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-3.2.14.jar!/security/serialize.allowlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.476+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize allow list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-common-3.2.14.jar!/security/serialize.allowlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.477+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize blocked list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-3.2.14.jar!/security/serialize.blockedlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.477+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.u.SerializeSecurityConfigurator : [DUBBO] Read serialize blocked list from jar:nested:/ruoyi-archives.jar/!BOOT-INF/lib/dubbo-common-3.2.14.jar!/security/serialize.blockedlist, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.480+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.s.c.DubboSpringInitializer : [DUBBO] Use default module model of target application: Dubbo Module[1.1.1], dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:16.480+08:00 INFO 1 --- [ruoyi-archives] [ main] o.a.d.c.s.c.DubboSpringInitializer : [DUBBO] Bind Dubbo Module[1.1.1] to spring container: org.springframework.beans.factory.support.DefaultListableBeanFactory@5b88b8e, dubbo version: 3.2.14, current host: 172.17.0.11 ___ _ _ ___ | __| __ _ ___ | || | ___ | __| ___ | _| / _` | (_-< \_, | |___| | _| (_-< |___| \__,_| /__/_ _|__/ _____ |___| /__/_ _|"""""|_|"""""|_|"""""|_| """"|_| |_|"""""|_|"""""| "`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' -----------------------------------------------------------> :: project :: Easy-Es > :: version :: 2.0.0 > :: home :: https://easy-es.cn/ > :: community :: https://dromara.org/ > :: wechat :: 252645816, add and become muscle man! > -----------------------------------------------------------> 2025-06-09T22:03:17.306+08:00 INFO 1 --- [ruoyi-archives] [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode 2025-06-09T22:03:17.310+08:00 INFO 1 --- [ruoyi-archives] [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2025-06-09T22:03:17.355+08:00 INFO 1 --- [ruoyi-archives] [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 27 ms. Found 0 Redis repository interfaces. 2025-06-09T22:03:17.511+08:00 INFO 1 --- [ruoyi-archives] [ main] c.s.b.f.a.ServiceAnnotationPostProcessor : [DUBBO] BeanNameGenerator bean can't be found in BeanFactory with name [org.springframework.context.annotation.internalConfigurationBeanNameGenerator], dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:17.511+08:00 INFO 1 --- [ruoyi-archives] [ main] c.s.b.f.a.ServiceAnnotationPostProcessor : [DUBBO] BeanNameGenerator will be a instance of org.springframework.context.annotation.AnnotationBeanNameGenerator , it maybe a potential problem on bean name generation., dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:17.521+08:00 INFO 1 --- [ruoyi-archives] [ main] c.s.b.f.a.ServiceAnnotationPostProcessor : [DUBBO] Found 1 classes annotated by Dubbo @Service under package [org.dromara.archives]: [org.dromara.archives.dubbo.ArchivesDubbonServiceImpl], dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:17.539+08:00 INFO 1 --- [ruoyi-archives] [ main] c.s.b.f.a.ServiceAnnotationPostProcessor : [DUBBO] Register ServiceBean[ServiceBean:org.dromara.archives.service.ArchivesServiceDubbon::]: Root bean: class [org.apache.dubbo.config.spring.ServiceBean]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null, dubbo version: 3.2.14, current host: 172.17.0.11 2025-06-09T22:03:17.556+08:00 WARN 1 --- [ruoyi-archives] [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[org.dromara.archives]' package. Please check your configuration. 2025-06-09T22:03:17.558+08:00 WARN 1 --- [ruoyi-archives] [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'org.dromara.common.mybatis.config.MybatisPlusConfiguration#MapperScannerRegistrar#0' defined in null: Could not resolve placeholder 'mybatis-plus.mapperPackage' in value "${mybatis-plus.mapperPackage}" 2025-06-09T22:03:17.591+08:00 INFO 1 --- [ruoyi-archives] [ main] .s.b.a.l.ConditionEvaluationReportLogger : Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2025-06-09T22:03:17.643+08:00 ERROR 1 --- [ruoyi-archives] [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'org.dromara.common.mybatis.config.MybatisPlusConfiguration#MapperScannerRegistrar#0' defined in null: Could not resolve placeholder 'mybatis-plus.mapperPackage' in value "${mybatis-plus.mapperPackage}" at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:230) ~[spring-beans-6.1.12.jar!/:6.1.12] at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.processProperties(PropertySourcesPlaceholderConfigurer.java:207) ~[spring-context-6.1.12.jar!/:6.1.12] at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.postProcessBeanFactory(PropertySourcesPlaceholderConfigurer.java:173) ~[spring-context-6.1.12.jar!/:6.1.12] at org.mybatis.spring.mapper.MapperScannerConfigurer.processPropertyPlaceHolders(MapperScannerConfigurer.java:406) ~[mybatis-spring-3.0.3.jar!/:3.0.3] at org.mybatis.spring.mapper.MapperScannerConfigurer.postProcessBeanDefinitionRegistry(MapperScannerConfigurer.java:360) ~[mybatis-spring-3.0.3.jar!/:3.0.3] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349) ~[spring-context-6.1.12.jar!/:6.1.12] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:148) ~[spring-context-6.1.12.jar!/:6.1.12] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:789) ~[spring-context-6.1.12.jar!/:6.1.12] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:607) ~[spring-context-6.1.12.jar!/:6.1.12] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.9.jar!/:3.2.9] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.9.jar!/:3.2.9] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.9.jar!/:3.2.9] at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.2.9.jar!/:3.2.9] at org.dromara.archives.RuoYiArchivesApplication.main(RuoYiArchivesApplication.java:28) ~[!/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:102) ~[ruoyi-archives.jar:na] at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64) ~[ruoyi-archives.jar:na] at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:40) ~[ruoyi-archives.jar:na] Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'mybatis-plus.mapperPackage' in value "${mybatis-plus.mapperPackage}" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) ~[spring-core-6.1.12.jar!/:6.1.12] at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-6.1.12.jar!/:6.1.12] at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) ~[spring-core-6.1.12.jar!/:6.1.12] at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-6.1.12.jar!/:6.1.12] at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:200) ~[spring-context-6.1.12.jar!/:6.1.12] at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:293) ~[spring-beans-6.1.12.jar!/:6.1.12] at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:219) ~[spring-beans-6.1.12.jar!/:6.1.12] at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:147) ~[spring-beans-6.1.12.jar!/:6.1.12] at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:85) ~[spring-beans-6.1.12.jar!/:6.1.12] at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:227) ~[spring-beans-6.1.12.jar!/:6.1.12] ... 20 common frames omitted 2025-06-09T22:03:17.647+08:00 WARN 1 --- [ruoyi-archives] [ Thread-6] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Start destroying Publisher 2025-06-09T22:03:17.647+08:00 WARN 1 --- [ruoyi-archives] [ Thread-4] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Start destroying common HttpClient 分析问题给出解决办法
06-10
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值