Solution to the error of @ resource annotation in eclipse spring

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

Common solutions to errors in checkout or commit of SVN

In using SVN checkout or commit times wrong, a similar error message as below

according to the prompt, the first thing we can choose to use the SVN menu of “clean up” option is trying to solve this problem

if the clean after found the problem still exists, we can give the correct local warehouse file backup to other directories first, then delete the error documents of local warehouse, from the remote warehouse to pull, and then compare our backup files related modification operations, You can recommit

Solution of project error reporting in eclipse

I. The project has a Red Cross:

Target runtime MyEclipse Tomcat V7.0 Unknown Faceted Project Problem
br> Target runtime MyEclipse Tomcat V7.0 Unknown Faceted Project Problem

2. To find the project directory. Mon. Under the Settings of org.eclipse.wst.com project. Facet. XML core.

3. Will & lt; The runtime name = “MyEclipse Tomcat v7.0″/& gt; Delete, and then right-click the project and refresh.

Second, the projects have a red exclamation point
right click – buildPath – see each TAB to see if there is failure jars or path error
Three, didn’t find the sessionFactory project appear this error:
the solution: (need SRC and res) in both directory to compile project right – buildPath – source – addFolder – check the res and SRC – ok

Right-click on the project –buildPath–Libraries– select JRE System Library–Edit– select Workspace Default JRE


Five, the project after import the captcha code error:
import com. Sun.. Image codec. Jpeg. JPEGCodec; .
import com. Sun. Image codec. Jpeg. JPEGImageEncoder;
Access: The type JPEGCodec is not accessible due to restriction on required library D:\eclipse\JDK7x64\jre\lib\rt.jar
br bb0 Access: restriction: The type JPEGCodec is not accessible due to restriction on required library D:\eclipse\JDK7x64\jre\lib\rt.jar Warning: Forbidden References (Access Rules) from the Deprecated and Restricted API in Windows-Preferences-Java-Complicer-Errors/Warnings.
2, [Project] ->; Properties -> Java Build Path -> Libraries -> Delete JRE System Library
and Add: Add Library ->; JRE System Library -> Click OK
3, [Project] -> Properties -> Java Build Path -> Libraries -> Double-click the JRE System Library and change it to “Workspace Default JRE”

Six, because of the relationship between work, Eclipse development of Java projects to copy, sometimes report a very strange error. Java Compiler Level does not match the version of the installed Java project facet “Java Compiler Level does not match the version of the installed Java project facet” when the source code is identical.
it is very easy to solve, actually under the resource manager, find the project directory, in. Settings subdirectories inside, use a text editor open org.eclipse.wst.com mon. Project. Facet. Core. The XML configuration file
content is as follows:
& lt; ?The XML version = “1.0” encoding = “utf-8”?>
& lt; faceted-project>
& lt; runtime name=”com.genuitec.runtime.generic.jee70″/>
& lt; fixed facet=”jst.web”/>
& lt; fixed facet=”wst.jsdt.web”/>
& lt; fixed facet=”java”/>
& lt; Installed facet = “Java” version = “1.7”/& gt;
& lt; Installed facet = “JST. Web” version = “3.1”/& gt;
& lt; Installed facet = “JST. Web. JSTL” version = “1.2.2”/& gt;
& lt; Installed facet = “WST. JSDT. Web” version = “1.0”/& gt;
& lt; /faceted-project>

& lt; Installed facet = “Java” version = “1.7”/& gt;
:
:
:
:
the right mouse button to select the project, click Properties, select the Java Compiler, you can see on the right side window to the Compiler version
check the Enable project specific Settings
check Use default the compliance Settings
the selection of the corresponding version into in accordance with the version = “1.7”

The reason of error in R file

1. Introduction
General R file error, nothing more than resource file error, picture naming error, but compilation will report error, can be quickly solved. However, a few days ago, after introducing a third-party AAR package, the project compiled correctly, but the R file failed to find the R file, and the whole project was in the red.
2. Wrong approach

Clean Project
Rebuild Project

I’m sure a lot of people, the first reaction is these two versions, but after trying both, found that still report errors. I closed the studio and reopened it several times, even rebooted the computer…
3. Solution
1) The R file should be generated, but it cannot be referenced. Then we go to the R file and open it.
When you open the R file, you find a line at the top of the R file, as shown in the figure below:

The IDE limits the size of files that can be associated, mainly to protect memory. The default value is 2500KB. Find the problem, and let’s fix it.
2) choose Android Studio under the Help menu of the Edit the Custom Properties, in the file to add: idea. Max. Intellisense. Filesize = 5000, and then restart the Android Studio. As shown in the figure:


After you restart Android Studio, everything should be fine.
 


If you have any mistakes, please point out and learn together.

about rs.last () error reporting

When writing to the statements rs.last() and rs.beforeFirst() that are used when querying data from a database, these methods return an error because Microsoft SQL does not have this method and requires additional statements to be added.

String SQL =”select * from stu_info”;// query key code
PreparedStatement PSTMT = dbConn. PrepareStatement (SQL,
the ResultSet. TYPE_SCROLL_INSENSITIVE, ResultSet. CONCUR_READ_ONLY); .
ResultSet rs = PSTMT executeQuery ();
 
Add the key code for the scarlet letter, and rs.last() will work.
However, the ResultSet.CONCUR_UPDATETABLE in the reference article will return an error. I don’t know why…
Refer to the article links: https://blog.csdn.net/pzasdq/article/details/52602730
 

Error in the project tag in the POM file of Maven project: failure to transfer

Question:
The Maven project was detected from SVN today, and the project label of the POM file after it was imported into ECLISE reported an error. The error content was very long, and the initial content was roughly Failure to Transfer…. + the version of a JAR package +…..
Solution:
Select the error report item, right-click on the item –>; Maven – & gt; Update Project, Force Updateo of Snapshots/Releases:

 
Just wait for the execution to finish, at least that’s how my error was resolved.
 
 
 

Common problems of Hadoop startup error reporting

After I have deployed Hadoop and YARN on the local virtual machine, I execute the startup command ./sbin/start-dfs.shbut I have various error reporting problems. Here I document two common problems.
Could not resolve hostname: Name or service not known
Error message:

19/05/17 21:31:18 WARN hdfs.DFSUtil: Namenode for null remains unresolved for ID null.  Check your hdfs-site.xml file to ensure namenodes are configured properly.
Starting namenodes on [jing-hadoop]
jing-hadoop: ssh: Could not resolve hostname jing-hadoop: Name or service not known
......

This is because without the node name in the configuration file jing - hadoop to join the domain mapping, so I can't identify the host name.
Solutions:

vim /etc/hosts
127.0.0.1  jing-hadoop

And then you start it up again.
jing-hadoop configured in h>site.xml , and t>orresponding node IP is 127.0.0.1e>. You should modify>according to your own environment, do not copy directly.
2, Unable to load Native Hadoop Library
Perform the start - DFS. Sh , also appeared the following error:

19/05/17 21:39:32 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
......

If you do not see the NameNode process after executing JPS, then this is definitely not possible.
The local classpath of Hadoop is not configured in the environment variable. The classpath is not configured in the environment variable.

vim /etc/profile

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"

source /etc/profile

Then, again start - DFS. Sh , will still be reported as errors found, but after executing the JPS, found the NameNode process and DataNode process has been started normally, so will not affect the use.

[root@localhost hadoop-2.4.1]# jps
3854 NameNode
4211 Jps
3967 DataNode
4110 SecondaryNameNode

Among them, the number of the DataNode and the IP is in $HADOOP_HOME/etc/hadoop slave file configuration, if the configure multiple IP, will start multiple DataNode process.