spring3.2与jdk1.8不兼容问题

JDK1.8 + spring 3.2 启动项目报错
DispatcherServlet - Context initialization failed
java.lang.IllegalArgumentException

javax.servlet.ServletException: Servlet.init() for servlet rootServlet threw exception

这是因为jdk1.8与spring3.2版本不兼容

将jdk版本降为1.7 或者 使用Spring4


如果使用spring4 则需要引入一下依赖
<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-context</artifactId>
   <version>4.3.9.RELEASE</version>
   <exclusions>
      <!-- Exclude Commons Logging in favor of SLF4j -->
      <exclusion>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
      </exclusion>
   </exclusions>
</dependency>
<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-webmvc</artifactId>
   <version>4.3.9.RELEASE</version>
</dependency>
如果没有此依赖会出现报错为
java.lang.IllegalArgumentException: No converter found for return value of type: class xxxxxxx
需要引入以下:
<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-core</artifactId>
   <version>2.8.8</version>
</dependency>
<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-databind</artifactId>
   <version>2.8.8</version>
</dependency>
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值