Could not autowire. No beans of 'JmsMessagingTemplate'

problem description

A springboot project in idea that automatically injects JmsMessagingTemplate errors although the project runs normally:

springbootspring.factoriesJmsMessagingTemplate:

JmsAutoConfiguration:

the environmental background of the problems and what methods you have tried

springboot version is 1.4.0 Magi maven coordinates are as follows:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-activemq</artifactId>
    </dependency>

some people on the Internet say that there is a space after the corresponding item in the springboot configuration file, but mine does not.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

@Autowired
private JmsMessagingTemplate jmsMessagingTemplate;

what result do you expect? What is the error message actually seen?

I want to know why springboot configured JmsMessagingTemplate for automatic injection, but also prompted that bean could not be found for automatic injection.
in addition, I know that I can use the @ Resource annotation to solve this problem, but this does not solve my doubts; I also know that I can configure the idea editor to ignore this error so as not to prompt that the bean, cannot be found, but this is obviously not the best thing to do.


since it works in the cloud, ignore this mistake. IDEA can only check the most general situation, and there is no need to spend time worrying about it. Maybe the next version won't have this problem.

Menu