springMVC依赖注意事项

springMVC

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>5.0.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.3.20.RELEASE</version>
</dependency>

一、如上,spring-webmvc的版本号不要超过spring-web的版本号,否则可能报包含如下内容的异常

nested exception is java.lang.NoClassDefFoundError: org/springframework/web/cors/CorsConfigurationSo

出现NoClassDefFoundError一般是jar包的问题

猜你喜欢

转载自www.cnblogs.com/kitor/p/12784083.html