SpringMVC与java版本冲突(一)

来源:互联网 发布:天价域名排 编辑:程序博客网 时间:2024/05/30 02:52

报错内容:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\java\apache-tomcat-7.0.78\wtpwebapps\spring01\WEB-INF\classes\com\tarena\controler\HelloController.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 [E:\java\apache-tomcat-7.0.78\wtpwebapps\spring01\WEB-INF\classes\com\tarena\controler\HelloController.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:290)

在网上查过许多资料,发现是Java版本问题,在我的eclipes中默认版本为1.8
最终解决如下步骤:

   项目右击------------点击Properties----------点击Project Facets-----------把Java版本修改为1.7

再次运行项目,成功访问页面。




原创粉丝点击