Error creating bean with name ‘configurationPropertiesBeans

created at 06-13-2022 views: 12

Spring access to Nacos got error

Error creating bean with name 'configurationPropertiesBeans'
  1. Add related dependencies

Note that the spring-cloud method is used to import here, and you need to pay attention to the compatibility of the two:

At the same time, it should be noted that the bootstap file is not supported after the spring-cloud version

<!--Service Discovery Dependency-->
<!--Remote configuration problem-->

1.Add a configuration file bootstrap.yml

     # default type
     active: dev
     name: xxxxxxxxx-${}
         # Specify the namespace of nacos
         namespace: ${}
         file-extension: yaml
         # nacos address
         server-addr: ${}
         namespace: ${}
           # metrics config
           - dataId: global-config.yml
             group: GLOBAL_GROUP
             refresh: true
             # email config
           - dataId: mail-config.yml
             group: GLOBAL_GROUP
             refresh: true
# ${} This method takes the jvm parameter first, and then takes the internal definition of the file; take as an example;
# Note that the name must be the same as the configuration name on nacos; use this matching

2.Add configuration parameters
  1. Start the program:

An error occurs

rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationPropertiesBeans' defined in class path resource [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]

The final investigation is springboot and spring cloud version conflict, it is OK to downgrade from 2.6.3 to 2.2.5.RELEASE

Online service error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '':

Reason investigation

Confirm missing class: org.apache.http.HttpRequestInterceptor

Belongs to the dependent jar package: httpcore;

Check dependencies: found set to test


Enter the container to confirm:

Missing jar package for httpcore in packaged lib

Dependency removed test scope and repackaged to the cloud, no problem


Introducing dependencies and adding test scope directly leads to the lack of these two dependent jar packages when packaging the project

created at:06-13-2022
edited at: 06-13-2022: