Common problems of spring and springmvc

1. Start-up error java.lang.IllegalArgumentException
: javax.servlet.ServletException: Servlet.init() for servlet springMVC threw exception
Reason: JDK version does not correspond to Spring MVC version.
Solution: Spring 3.x corresponds to JDK 1.7.x or below; Spring 4.x corresponds to JDK 1.8.x

2. The program can be used normally, but a red cross
Referenced file contains errors appears at the beginning of xml (http://www.springframework.org/schema/context/spring-context-3.2.xsd). For more information, right click on the message in the Problems View and select "Show Details..."
Insert picture description here
Solution: The campus network I used at the beginning, change to another network, this problem will not appear. After changing the network, the right mouse button validates that the springmvc.xml
campus network cannot read the xsd file, Failed to read schema document'http: //www.springframework.org/schema/context/spring-context.xsd ',

3. The program can be used normally, but the configuration scan shows an error.
Multiple annotations found at this line:
-cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element'context:component-scan '.
-schema_reference.4: Failed to read schema document'http://www.springframework.org/schema/context/spring-context.xsd',
because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema.
Insert picture description here
Solution: The campus network I used at the beginning, change to another network, this problem will not appear. Questions 2 and 3 have nothing to do with whether there is a space in the last quotation mark of xsi:schemaLocation=" ". Besides, even if I add spring-context.xsd, it is of any use.

4. How to download files from spring official website
. Download jar, source code, xsd, etc. from the official website, please refer to the article

5、JSP页面
Multiple annotations found at this line:
- The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- - Line breakpoint:add.jsp [line: 1]
解决:右键项目——build path——configure build path——Add Library –> server Runtime -> Click Next,选择tomcat即可

6. java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor
Reason: missing jar package
org.springframework.asm-3.0.5.RELEASE.jar
solution: just import the asm package

Guess you like

Origin blog.csdn.net/root_zhb/article/details/109195617