异常信息如下:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\DateFile\eclipse_workspace2\springmvc\target\classes\cn\springmvc\service\impl\UserServiceImpl.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 [D:\DateFile\eclipse_workspace2\springmvc\target\classes\cn\springmvc\service\impl\UserServiceImpl.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:290)问题原因:spring3.2是不能与jdk1.8兼容的.
解决办法:换jdk改成1.7,改project facets 里面java的版本。
另:spring3.X是不支持@RestController注解的,spring4.X才支持。
但是spring3.X 据说也可以写支持restful风格的controller。具体还没有实验,待以后有时间会将学习结果更新。
注:本文作为学习记录之用,如有任何违反规则,请联系我,我会及时删除。