An error is reported after the @resource annotation is introduced into the spring project
Solution:
@Resource annotations are provided by J2EE
However, jdk1.9 and above versions need to import a javax.annotation dependency package from pom.xml in maven:
<dependencies> <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version>1.3.2</version> </dependency> </dependencies>
Read More:
- Annotation @resource & @Autowired introduces Spring bean error
- [Solved] IDEA Import springboot Project Error: Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:<unknown>
- Springboot reports an error After adding the import annotation: application failed to start
- Spring Project Error: Error creating bean with name [How to Solve]
- [ERROR] Failed to execute goal on project simple-project: Could not resolve dependencies for project
- [Solved] the resource is not on the build path of a java project
- Resources is configured in the build of Maven project to prevent the failure of resource export
- Idea Error 404: The project ssmbuild is unavailable/the target resource cannot be found
- [Solved] Spring Boot Project Error: Failed to load property source from
- [Solved] Annotation Customize Error: ElementType cannot be resolved to a variable
- [Integrate the mobile MAS SMS service] SDK start error: NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtil
- How to Solve Spring integrate Seata startup error
- Zuul Gateway Failed to Import Dependency [How to Solve]
- spring cloud 2020 gateway Error 503 [How to Solve]
- [Solved] JAVA Project Import jstl Error: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
- Maven Project Right-Click -update project Error [How to Solve]
- Eclipse relies on spring boot configuration processor, and there is no prompt for writing properties and YML
- [Solved] Spring Cloud Use Ribbon Error: No instances available for XXX