I am using FullyQualifiedAnnotationBeanNameGenerator which comes from org.springframework:spring-context. With the latest pom upgrade I see this class is not present in spring-context jar. What is the substitute of this class now? I am using org.springframework:spring-context:jar:4.3.25.RELEASE
Asked
Active
Viewed 584 times
2 Answers
0
you have upgraded from which version to 4.3.25-RELEASE
If we follow the spring documentation: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/FullyQualifiedAnnotationBeanNameGenerator.html
this annotation was introduced since 5.2.3
can you please try using this 5.2.3 or above version and it should solve your problem.

Manish Tiwari
- 11
- 2
0
Here is the solution. if your spring-context is lower than 5.2.3.RELEASE.
Use this approach:
- You can implement your own bean-name generation strategy which use fully-qualified name:
public class UniqueBeanNameGenerator extends AnnotationBeanNameGenerator {
@Override
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
return definition.getBeanClassName();
}
}
- Add this to spring boot app start class
@SpringBootApplication
@ComponentScan(nameGenerator=UniqueNameGenerator.class)
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}