Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am getting the following error while trying to execute this code.
java.lang.IllegalArgumentException: No ConfigurationProperties annotation found on 'com.app.AggregatorAppAConfiguration'.
at org.springframework.util.Assert.notNull(Assert.java:115) ~[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.boot.context.properties.EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.registerBeanDefinition(EnableConfigurationPropertiesImportSelector.java:117) ~[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
Wondering what is done wrong here
@Component
public class AggregatorApp
private static final Logger logger = LoggerFactory.getLogger(AggregatorApp.class);
public static void main( String[] args )
logger.info("good");
SpringApplication app = new SpringApplication(AggregatorAppAConfiguration.class);
app.setWebEnvironment(false);
ConfigurableApplicationContext ctx = app.run(args);
ctx.getBean(AggregatorApp.class).run();
public void run() {
aggManager.start();
System.out.println("Hello World !!");
@Service
public class AggregatorManager {
public void start() {
System.out.println("Hello World");
@Configuration
@ComponentScan("com.app.aggregator")
@EnableConfigurationProperties(AggregatorAppAConfiguration.class)
@EnableAutoConfiguration
public class AggregatorAppAConfiguration {
@Bean
public AggregatorManager aggregatorManager()
return new AggregatorManager();
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.