IllegalArgumentException Could not resolve placeholder

异常信息:
错误信息


Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
[2018-12-01 10:35:28.662] [ace-external-web] [] [main] [ERROR] o.s.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'contractController': Unsatisfied dependency expressed through field 'signService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'signServiceImpl': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'setting.enterprise.fuLong.fullName' in value "${setting.enterprise.fuLong.fullName}"
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
	at com.fujfu.ace.external.ExternalApplication.main(ExternalApplication.java:25)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'signServiceImpl': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'setting.enterprise.fuLong.fullName' in value "${setting.enterprise.fuLong.fullName}"
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
	... 19 common frames omitted
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'setting.enterprise.fuLong.fullName' in value "${setting.enterprise.fuLong.fullName}"
	at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
	at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
	at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236)
	at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
	at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:172)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:837)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1086)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
	... 30 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:52202', transport: 'socket'

原因:
active 的值没用@@引起来
在这里插入图片描述

解决:
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: Q: 'illegalargumentexception: could not resolve placeholder' 是什么意思? A: 这个错误表示应用程序在解析配置文件时找不到占位符所引用的值。可能是因为占位符没有被正确定义,或者没有对应的属性文件。 ### 回答2: IllegalArgumentException: Could not resolve placeholder 是一个常见的错误类型,通常会在Spring应用程序的上下文中出现。这个错误通常是由于某些配置文件中的占位符未能正确读取值导致的。 在Spring应用程序中,占位符通常用于读取外部配置文件中的某些值。这些占位符在应用程序启动过程中被解析为实际的值,并用于配置应用程序的不同方面。如果某个占位符未能正确读取值,则会出现IllegalArgumentException: Could not resolve placeholder错误。 常见的错误包括以下几种: 1. 占位符未能正确匹配:这可能是由于有拼写错误或者语法错误等原因导致的。 2. 占位符未能正确读取值:这可能是由于配置文件路径不正确或者文件不存在等原因导致的。 3. 占位符未能正确解析:这可能是由于缺少必要的依赖项导致的。 解决这个问题的方法通常是检查占位符的拼写和语法是否正确。然后,检查配置文件路径是否正确,并确保文件存在。最后,检查应用程序的依赖项是否正确,并确保它们可以正确解析占位符。 总之,当出现IllegalArgumentException: Could not resolve placeholder错误时,通常需要仔细检查应用程序的配置文件和依赖项,以确保所有的占位符都能够正确读取值。 ### 回答3: illegalargumentexception: could not resolve placeholder,通常出现在Spring应用程序中,这是由于在属性中使用了无法解析的占位符导致的。在一个Spring应用程序中,我们通常使用属性文件对应用程序进行配置。在这些属性文件中,我们可以提供不同的值来配置应用程序中的不同组件。这些值可以通过占位符来引用,Spring框架将在运行时解析这些占位符并将其替换为实际的值。但是,如果在属性文件中提供了一个未定义的占位符,并且在应用程序中引用了该占位符,就会出现illegalargumentexception: could not resolve placeholder的异常。 为了解决这个问题,我们需要检查应用程序的属性文件,确保我们提供了正确的值,并且所有引用占位符的地方都已经正确定义。我们还可以尝试使用不同的属性文件(或默认值),或者使用注解来配置应用程序中的组件。另外,如果我们在引用占位符时希望Spring框架忽略不存在的数据,我们可以将应用程序的日志级别设置为WARN或ERROR。 总之,illegalargumentexception: could not resolve placeholder是在Spring应用程序中常见的问题,通常由未定义的占位符引起。为了解决这个问题,我们需要检查应用程序的属性文件,并确保提供了正确的值,同时确保所有引用占位符的地方都已经正确定义。如果需要,我们可以使用不同的属性文件,或者使用注解来配置应用程序中的组件。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值