The @Resource annotation in Eclipse-Spring is used to report an error
1. Problems arise
2. The cause of the problem
@ the Resource is equivalent to the applicationContext. GetBean method, is the annotation – API. The class in the jar package, only support is jdk1.6 annotations, and their default is jdk1.5 (pictured) of the project, so the JDK version because the project is too low, there is an error.
3. Solutions
1. Place the cursor on the project — right click — find Build Path — and then go to Configure Build Path (select)
.
> Find the Java Bulib Path — Libraries — Select the default JRE System Library[J2SE-1.5] — double-click — check Workspace Default JRE (JRE 1.8.0_121)* (this will work if you change to the latest)*.
the default format:
to this format:
4, successfully solved the
modification is done, another to write @ Resource annotation automatically prompts, and there is no error
Read More:
- @Solution to get / set error in eclipse after using data annotation
- @How to solve eclipse error after setter and @ getter (@ data) annotation
- Error pathvariable annotation was empty on param 0 when migrating idea to eclipse
- IntelliJ idea / eclipse automatically generate author annotation signature
- Eclipse reset annotation shortcuts
- Solution to garbled code problem after importing project in eclipse
- After eclipse eclipse eclipse imports the correct project, an error is reported in XML and other files
- The solution to “polling news feeds” appeared in Eclipse in Java
- Solution to the problem of no C / C + + option in the new project of eclipse
- The solution of using Autowired annotation to report errors in IntelliJ idea
- Access restriction in Eclipse: the type ‘xxx’ is not API solution
- Tomcat memory overflow in Eclipse: Java. Lang. outofmemoryerror: permgen space solution:
- Solution of idea using @ Autowired annotation to report errors
- The solution of red X in eclipse error pages
- Solution of server startup timeout in eclipse
- Solution to device or resource busy error in docker redeployment service
- [SharePoint] after deploying webpart, the solution to the resource file in the layouts mapping directory referenced by webpart cannot be found
- Spring MVC – enable static resource access
- The solution of a Java exception has occurred. And error exception in thread when eclipse runs
- Spring ApplicationContext – Resource leak: ‘context’ is never closed