Skip to content

BeanFactoryPostProcessor and @Bean problems #4711

@vongosling

Description

@vongosling

some lib using BFPP to do customized things,i want to modify this to spring boot,so I use this styple

@Bean
@ConditionalOnMissingBean
public BeanFactoryPostProcessor hSpringProviderPackageScanner() {
  .....
  Environment env = applicationContext.getEnvironment();
}

But this method would result in my datasource properties can not autowired,as @bean javadoc said.i try to modify hSpringProviderPackageScanner to static,but in my hSpringProviderPackageScanner method ,I want to get some beans from applicationContext(but can not get this instance from static field) . how to do this ?please give me some advice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions