When using springboot’s @Autowired injection, a red wavy line appears. The interface after Alt + enter is as follows
The solution is: add (required = false
) after @Autowired, and the red wavy line will disappear
@Autowired(required = false)
Read More:
- Springboot startup error: Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl required a bean of type
- [Solved] Springboot error: Could Not Found xxmapper
- [Solved] ssm Error: Error creating bean with name ‘employeeController’: Injection of autowired dependencies failed
- [Solved] Springboot2.x ElasticSearch Error: availableProcessors is already set to [4], rejecting [4]
- Request processing failed; nested exception is java.lang.NullPointerException or UnsatisfiedDependencyE
- Error assembling War: webxml attribute is required
- Error starting ApplicationContext. To display the conditions report re-run your application with ‘de
- [Solved] BeanCreationNotAllowedException:Error creating bean with name ‘rabbitConnectionFactory‘:
- Spring Project Error: Error creating bean with name [How to Solve]
- Public Key Retrieval is not allowed [How to Solve]
- How to Solve IDEA @Autowired Error
- Failed to start bean ‘documentationPluginsBootstrapper‘ [How to Solve]
- [Solved] Consider defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ in your configu
- How to Solve error creating bean with name when springboot starts
- [Solved] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- [Solved] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure error
- Xdoc generates API documents based on Java annotations
- [Solved] HttpMessageNotReadableException: JSON parse error: Unrecognized field “xxxx“
- Springboot uses Oracle database to report property ‘sqlsessionfactory’ or ‘sqlsessiontemplate’ are required
- [Solved] Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type…