今天在Spring整合的過程中,遇到了個(gè)很奇怪的問題,打印的錯(cuò)誤日志如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0' defined in URL [file:/Users/lijie/java_web/student_manager/out/artifacts/student_manager_war_exploded/WEB-INF/classes/spring-mvc-servlet]: Initialization of bean failed; nested exception is java.lang.NullPointerException;
...
java.lang.IllegalStateException: Expected raw type form of org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistryjava.lang.IllegalStateException: Expected raw type form of org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry
經(jīng)過排查,引起的原因是用了AspectJ 1.8.10這個(gè)包。這個(gè)是jar包內(nèi)部的錯(cuò)誤,回退到前一個(gè)版本就ok了。
具體可以參考:https://jira.spring.io/browse/SPR-15019
http://www.th7.cn/Program/java/201701/1087660.shtml