ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn

错误产生的信息如下:

Caused by: 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:\develop_tools\apache-tomcat-8.0.18\webapps\SpringMVCUploadFileDemo\WEB-INF\classes\com\evan\action\UploadFileAction.class]; nested exception is java.lang.IllegalArgumentException

at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:56)

at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)

at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)

at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:257)

… 39 more

Caused by: java.lang.IllegalArgumentException

at org.springframework.asm.ClassReader.(Unknown Source)

产生的原因是:我用的JDK8.0版本,而spring使用的是3.2。

解决办法是:将项目的编译版本降到1.7即可。

具体如下:

在项目上右键–properties–java Compile–compiler compliance level 如图所示:

设置好编译版本后,项目上会有红色的小叉,不过这样不会影响项目的运行。

=================================

原版英文解释如下:

you need Spring 4 if you want compile code to Java 8 (–target 1.8), but you can still run apps on Java 8 compiled to Java 7 if you run on Spring 3.2.X.

时间: 2024-10-12 15:14:22

ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn的相关文章

Spring MVC 单元测试异常 Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file

Sping 3.2.8.RELEASE + sping mvc + JDK 1.8运行异常. java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springfr

ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet

1. 问题描述 tomcat启动项目 报错如上,ide是eclipse,jdk安装的是jdk8. 2. 解决方案 可能原项目是用jdk7或其他版本开发的,错误提示也很清晰,更换jdk编译一下 项目右键-->build path-->Configure build path-->Project facets 再重新发布 启动好了 ASM ClassReader failed to parse class file - probably due to a new Java class fil

Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file

最近在琢磨maven,自己照着网上的例子塔了一个例子,在junit测试时报错了,详细错误信息: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\workspace\MAVEN\example_1\target\classes\cn\springmvc\service\impl\UserServiceImpl.clas

ASM ClassReader failed to parse class file- probably due to a new Java class file version that isn't supported yet问题

出错情况:由于接口的更改,在工程中更新了一个外部依赖的jar包,在编译启动后遇到了下述问题: Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a newJava class file version that isn't supported yet: URL [jar:file:/D:/project/extra-

SpringMVC 异常信息ASM ClassReader failed to parse class file的问题解决

1.  环境信息: Spring 3.2.0,  JDK 1.8.0 2.  运行简单的程序,出现以下错误信息: 2.  运行简单的程序,出现以下错误信息: Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\NewWorkSpace\ep-user\target\test-classes\org\

Java 关于File使用

1. File类 1.1. File类说明 存储在变量,数组和对象中的数据是暂时的,当程序终止时他们就会丢失.为了能够永 久的保存程序中创建的数据,需要将他们存储到硬盘或光盘的文件中.这些文件可以移动,传送,亦可以被其他程序使用.由于数据存储在文件中,所以我们需要学习一个和文件有密切关系的类,叫做File类,将要掌握获取文件的属性以及删除和重命名文件.最终如何向文件中写入数据和从文件中读取数据. 那么File类关心的是在磁盘上文件的存储. File类描述的是一个文件或文件夹.(文件夹也可以称为目

【Java】File.createTempFile创建临时文件

API参数: /** fileName: 临时文件的名字, 生成后的文件名字将会是[fileName + 随机数] suffix: 文件后缀,例如.txt, .tmp parentFile: 临时文件目录,如果不指定,则默认把临时文件存储于系统临时文件目录上        */ public static File createTempFile(String fileName,                       String suffix,                       

ssh整合context:component-scan包名写了*号:Failed to parse configuration class [org.springframework.cache.aspectj.AspectJJCacheConfiguration]

1 2 3 4 03-Apr-2016 00:27:57.154 WARNING [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.

处理 javax.el.ELException: Failed to parse the expression 报错

在JSP的表达式语言中,使用了  <h3>是否新Session:${pageContext.session.new}</h3>  输出Session是否是新的,此时遇到了  javax.el.ELException: Failed to parse the expression  报错.这里主要是因为在Tomcat7中表达式的权限变小了,如果遇到JAVA的关键字,就会出现此种错误,在这个例子中就是因为 new 是JAVA的关键字,所以才会出错. 解决办法:设置启动参数   -Dor