提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
- 记录1:Cannot load configuration class: Spring.Configuration.SpringConfiguration
- 记录2:Could not initialize class org.springframework.beans.CachedIntrospectionResults
- 记录3:@ContextConfiguration爆红
- 记录4:缺失web.xml
- 记录4:<servlet-name>UserServlet</servlet-name>爆红
- 记录5:tomcat报错 org.apache.tomcat.util.descriptor.web.WebXml.setVersion 未知版本字符串 [4.0]。将使用默认版本。
- 记录6:Tomcat 404
记录1:Cannot load configuration class: Spring.Configuration.SpringConfiguration
解决方案:
- 降低项目使用的jdk版本
- 引入高版本的Spring
https://www.cnblogs.com/greengages/p/15740944.html
记录2:Could not initialize class org.springframework.beans.CachedIntrospectionResults
解决方案:
常见情况为无法找到bean依赖,对注解及配置文件排查可解决,但不排除jar包冲突及其余错误可能
https://blog.csdn.net/weixin_43977226/article/details/115896325
记录3:@ContextConfiguration爆红
解决方案:
https://www.freesion.com/article/8471744839/
记录4:缺失web.xml
解决方案:
https://blog.csdn.net/weixin_43253762/article/details/120341889
记录4:UserServlet爆红
解决方案:
https://blog.csdn.net/weixin_43253762/article/details/120341889
记录5:tomcat报错 org.apache.tomcat.util.descriptor.web.WebXml.setVersion 未知版本字符串 [4.0]。将使用默认版本。
解决方案:
https://blog.csdn.net/easysec/article/details/122913644?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-122913644-blog-123025140.pc_relevant_multi_platform_whitelistv1&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-122913644-blog-123025140.pc_relevant_multi_platform_whitelistv1&utm_relevant_index=1
记录6:Tomcat 404
解决方案:
原因有很多种,列举一个常见合集https://blog.csdn.net/qq_44491991/article/details/109626305
遇见场景为https://ask.csdn.net/questions/7751326/53837264
多次尝试配置项目路径为/仍404,原因为与ROOT路径冲突,修改ROOT路径并配置项目路径为/即可
报错org.apache.catalina.core.StandardContext.startInternal
Failed to introspect Class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandler
修改为5.0.5版本
java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext…
https://blog.csdn.net/wangxinyao1997/article/details/88087564
tomcat使用controller进行视图跳转jsp
404/显示为jsp文件名的字符串
需要对配置文件进行修改
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/</value> <!-- 表示要调用的文件前缀,即表示要调用的文件在/WEB-INF/路径下 -->
</property>
<property name="suffix">
<value>.jsp</value> <!-- 表示要调用的文件后缀,即表示是jsp文件 -->
</property>
</bean>
https://blog.csdn.net/u014453898/article/details/79559822