- springmvc中跳转页面时报异常:
- java.lang.NullPointerException
- org.springframework.core.SerializableTypeWrapper$TypeProxyInvocationHandler.invoke(SerializableTypeWrapper.java:239)
- 是因为dubbo和spring整合中出现了包冲突,dubbo中maven依赖传递中存在spring包,当我们在项目中再次引入spring依赖包的时候,项目就会出现冲突问题。
- 解决方法:
在pom.xml中加入
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<exclusions>
<exclusion>
<artifactId>spring</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<exclusions>
<exclusion>
<artifactId>spring</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
去掉dubbo的spring依赖传递。