-
Notifications
You must be signed in to change notification settings - Fork 937
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Interface ConfigurableEnvironment should be enough for bellow code:
code link:
Line 55 in 2109762
| private StandardEnvironment environment; |
My application has a customized ConfigurableEnvironment implementation, but it cannot startup correctly.
Below is a demo code fragment:
@SpringBootApplication
public class App {
@Resource
private RocketMQTemplate rocketMQTemplate;
public static void main(String[] args) {
SpringApplication app = new SpringApplication(App.class);
app.setEnvironment(new MyEnv()); // comment out this line fixies the problem
app.run(args);
}
static class MyEnv extends AbstractEnvironment {
}
}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: {}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request