关于idea中使用注解开发springmvc 500报错
可能是spring版本与jdk版本不匹配
将jdk14.0.2换为jdk1.8.0即可正常运行
类型 异常报告
消息 Servlet[springmvc]的Servlet.init()引发异常
根本原因。
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\Users\FHun\IdeaProjects\springmvc-01-mvc\out\artifacts\springmvc_01_controller_war_exploded\WEB-INF\classes\com\FHun\Controller\ControllerTest01.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn’t supported yet: file [C:\Users\FHun\IdeaProjects\springmvc-01-mvc\out\artifacts\springmvc_01_controller_war_exploded\WEB-INF\classes\com\FHun\Controller\ControllerTest01.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 58
报错时使用的是jdk14.0.2
spring依赖版本为
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
后来发现可能是spring版本与jdk版本不匹配
将jdk14.0.2换为jdk1.8.0即可正常运行