You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My application has a customized ConfigurableEnvironment implementation, but it cannot startup correctly.
Below is a demo code fragment:
@SpringBootApplicationpublicclassApp {
@ResourceprivateRocketMQTemplaterocketMQTemplate;
publicstaticvoidmain(String[] args) {
SpringApplicationapp = newSpringApplication(App.class);
app.setEnvironment(newMyEnv()); // comment out this line fixies the problemapp.run(args);
}
staticclassMyEnvextendsAbstractEnvironment {
}
}
it reports bellow error on startup:
Error creating bean with name 'org.apache.rocketmq.spring.autoconfigure.ListenerContainerConfiguration':
Unsatisfied dependency expressed through constructor parameter 1;
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'org.springframework.core.env.StandardEnvironment' available:
expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations: {}
The text was updated successfully, but these errors were encountered:
Interface
ConfigurableEnvironment
should be enough for bellow code:code link:
rocketmq-spring/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/autoconfigure/ListenerContainerConfiguration.java
Line 55 in 2109762
My application has a customized
ConfigurableEnvironment
implementation, but it cannot startup correctly.Below is a demo code fragment:
it reports bellow error on startup:
The text was updated successfully, but these errors were encountered: