• org.springframework.beans.factory.BeanCreationException


    异常代码:

    Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
    18:19:30.886 [main] ERROR o.s.boot.SpringApplication - Application startup failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initializeData': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'lainlianpay.request.url.payApplyUrl' in value "${lainlianpay.request.url.payApplyUrl}"
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
        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:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        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)

    出现这个异常在于创建对象时,其属性并没有成功的注入。原因在于没有选择正确的开发配置文件。

    因为是通过注入的方式给属性赋值的,所以一定要注意配置文件是在哪里书写的,书写的名称与注解是否相符

  • 相关阅读:
    在数值中加入千位分隔符的方法
    用 Javascript 验证表单(form)中的单选(radio)值
    用 Javascript 验证表单(form)中多选框(checkbox)值
    用 CSS 实现图片替换文字(Image replacement)
    计算机技术分类
    最近好乱acm与数模时间重复了
    memcached Telnet Interface
    event_new
    event_base_loop
    event_base_loop
  • 原文地址:https://www.cnblogs.com/lilinzhiyu/p/8029147.html
Copyright © 2020-2023  润新知