`

UnsupportedClassVersionError & eclipse下@override报错

阅读更多
碰到了这么个问题:
[14:30:26.244] javax.servlet.ServletException: Unable to instantiate Action, com.ambow.upgrade.extraction.action.DataExtractAction,  defined for 'syncAction' in namespace '/datasync'Error creating bean with name 'classStuRealExtractService' defined in file [/opt/resin/webapps/lylearnnet/WEB-INF/classes/spring/applicationContext-dataExtract.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ambow.upgrade.extraction.service.impl.ClassStuRealExtractServiceImpl]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: com/ambow/upgrade/extraction/dao/ClassStuRealExtractDAO : unsupported classversion 50.0
[14:30:26.244]  at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:236)
[14:30:26.244]  at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
[14:30:26.244]  at com.ambow.core.web.filter.FilterLogin.doFilter(FilterLogin.java:62)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
[14:30:26.244]  at com.ambow.core.web.filter.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:238)
[14:30:26.244]  at com.ambow.sso.client.filter.SsoFilter.doFilter(SsoFilter.java:97)
[14:30:26.244]  at com.ambow.core.web.filter.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:250)
[14:30:26.244]  at com.ambow.core.web.filter.FilterChainProxy.doFilter(FilterChainProxy.java:129)
[14:30:26.244]  at com.ambow.core.web.filter.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:73)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
[14:30:26.244]  at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
[14:30:26.244]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
[14:30:26.244]  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
[14:30:26.244]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
[14:30:26.244]  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
[14:30:26.244]  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
[14:30:26.244]  at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:424)
[14:30:26.244]  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
[14:30:26.244]  at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
[14:30:26.244]  at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
[14:30:26.244]  at java.lang.Thread.run(Thread.java:595)
[14:30:26.244] Caused by: Unable to instantiate Action, com.ambow.upgrade.extraction.action.DataExtractAction,  defined for 'syncAction' in namespace '/datasync'Error creating bean with name 'classStuRealExtractService' defined in file [/opt/resin/webapps/lylearnnet/WEB-INF/classes/spring/applicationContext-dataExtract.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ambow.upgrade.extraction.service.impl.ClassStuRealExtractServiceImpl]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: com/ambow/upgrade/extraction/dao/ClassStuRealExtractDAO : unsupported classversion 50.0
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.createAction(DefaultActionInvocation.java:243)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.init(DefaultActionInvocation.java:322)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.<init>(DefaultActionInvocation.java:71)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.<init>(DefaultActionInvocation.java:64)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxyFactory.createActionInvocation(DefaultActionProxyFactory.java:28)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxy.prepare(DefaultActionProxy.java:148)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxy.<init>(DefaultActionProxy.java:78)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:46)
[14:30:26.244]  at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:216)
[14:30:26.244]  ... 23 more
[14:30:26.244] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'classStuRealExtractService' defined in file [/opt/resin/webapps/lylearnnet/WEB-INF/classes/spring/applicationContext-dataExtract.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ambow.upgrade.extraction.service.impl.ClassStuRealExtractServiceImpl]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: com/ambow/upgrade/extraction/dao/ClassStuRealExtractDAO : unsupported classversion 50.0
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:270)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:881)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:829)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:276)
[14:30:26.244]  at com.opensymphony.xwork.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:153)
[14:30:26.244]  at com.opensymphony.xwork.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:140)
[14:30:26.244]  at com.opensymphony.xwork.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:117)
[14:30:26.244]  at com.opensymphony.xwork.ObjectFactory.buildAction(ObjectFactory.java:101)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.createAction(DefaultActionInvocation.java:224)
[14:30:26.244]  ... 31 more
[14:30:26.244] Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ambow.upgrade.extraction.service.impl.ClassStuRealExtractServiceImpl]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: com/ambow/upgrade/extraction/dao/ClassStuRealExtractDAO : unsupported classversion 50.0
[14:30:26.244]  at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
[14:30:26.244]  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:759)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:724)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:387)
[14:30:26.244]  ... 41 more
[14:30:26.244] Caused by: java.lang.UnsupportedClassVersionError: com/ambow/upgrade/extraction/dao/ClassStuRealExtractDAO : unsupported classversion 50.0
[14:30:26.244]  at java.lang.ClassLoader.defineClass1(Native Method)
[14:30:26.244]  at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
[14:30:26.244]  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
[14:30:26.244]  at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1329)
[14:30:26.244]  at com.caucho.loader.DynamicClassLoader.findClass(DynamicClassLoader.java:1199)
[14:30:26.244]  at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1119)
[14:30:26.244]  at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1068)
[14:30:26.244]  at com.ambow.upgrade.extraction.service.impl.ClassStuRealExtractServiceImpl.<init>(ClassStuRealExtractServiceImpl.java:32)
[14:30:26.244]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[14:30:26.244]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[14:30:26.244]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[14:30:26.244]  at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
[14:30:26.244]  at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
[14:30:26.244]  at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:759)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:724)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:387)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:270)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:881)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:829)
[14:30:26.244]  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:277)
[14:30:26.244]  at com.opensymphony.xwork.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:153)
[14:30:26.244]  at com.opensymphony.xwork.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:140)
[14:30:26.244]  at com.opensymphony.xwork.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:117)
[14:30:26.244]  at com.opensymphony.xwork.ObjectFactory.buildAction(ObjectFactory.java:101)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.createAction(DefaultActionInvocation.java:224)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.init(DefaultActionInvocation.java:324)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.<init>(DefaultActionInvocation.java:72)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionInvocation.<init>(DefaultActionInvocation.java:65)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxyFactory.createActionInvocation(DefaultActionProxyFactory.java:28)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxy.prepare(DefaultActionProxy.java:148)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxy.<init>(DefaultActionProxy.java:79)
[14:30:26.244]  at com.opensymphony.xwork.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:46)
[14:30:26.244]  at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:216)
[14:30:26.244]  at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:74)
[14:30:26.244]  at com.ambow.core.web.filter.FilterLogin.doFilter(FilterLogin.java:62)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:74)
[14:30:26.244]  at com.ambow.core.web.filter.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:238)
[14:30:26.244]  at com.ambow.sso.client.filter.SsoFilter.doFilter(SsoFilter.java:99)
[14:30:26.244]  at com.ambow.core.web.filter.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:250)
[14:30:26.244]  at com.ambow.core.web.filter.FilterChainProxy.doFilter(FilterChainProxy.java:130)
[14:30:26.244]  at com.ambow.core.web.filter.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:74)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:74)
[14:30:26.244]  at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
[14:30:26.244]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:74)
[14:30:26.244]  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:97)
[14:30:26.244]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
[14:30:26.244]  at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:74)
[14:30:26.244]  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
[14:30:26.244]  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:241)
[14:30:26.244]  ... 5 more



应用部署在resin中;上传我本地的某个class文件后,访问action时抛出如上异常;java -version,发现linux下的jdk版本是1.5,而我本地是1.6的。更换编译器为1.5,重新上传编译后的class文件,即可。


参见:
Eclipse @override报错解决
http://justdo2008.iteye.com/blog/433579
分享到:
评论

相关推荐

    java.lang.UnsupportedClassVersionError问题的解决方法

    ### java.lang.UnsupportedClassVersionError问题的解决方法 在开发Java应用程序的过程中,经常会遇到与JDK版本不兼容的问题,其中一种常见的异常就是`java.lang.UnsupportedClassVersionError`。该错误通常发生在...

    java.lang.UnsupportedClassVersionError Bad version number in .class file异常的解决办法

    这种错误通常发生在编译器版本与实际使用的JVM版本不匹配的情况下,比如使用了较新的Java编译器生成的`.class`文件在较旧的JVM上运行时就会触发此类异常。 #### 二、错误原因分析 该错误的主要原因是由于MyEclipse...

    java.lang.UnsupportedClassVersionError问题解决

    该错误通常发生在类文件版本与JVM(Java虚拟机)版本不匹配的情况下。本文将详细介绍该错误产生的原因、如何诊断问题以及具体的解决策略。 #### 一、问题背景 当出现`java.lang.UnsupportedClassVersionError`错误...

    weblogic安装步骤以及报错解决

    Weblogic 安装步骤以及报错解决 Weblogic 是一款功能强大且流行的中间件,广泛应用于企业级应用系统中。但是,安装 Weblogic 可能会遇到各种问题,本文将提供详细的安装步骤和报错解决方案,以帮助用户顺利安装和...

    UnsupportedClassVersionError如何解决.md

    UnsupportedClassVersionError如何解决.md

    UnsupportedClassVersionError解决办法.md

    UnsupportedClassVersionError解决办法.md

    Java编译错误-UnsupportedClassVersionError.txt

    ### Java编译错误 - UnsupportedClassVersionError 解析 #### 标题解读 “Java编译错误 - UnsupportedClassVersionError”这一标题明确指出了解决的问题核心是Java中的`UnsupportedClassVersionError`异常。这是一...

    Eclipse 工具的使用

    ### Eclipse 开发工具的使用技巧 #### 一、Eclipse 概述 1. **Eclipse 的起源**:Eclipse 是由 IBM 开发的一款开源集成开发环境(IDE),专为 Java 开发人员设计。它拥有丰富的插件生态系统,能够极大地扩展其功能...

    UnsupportedClassVersionError(解决方案).md

    UnsupportedClassVersionError(解决方案).md

    Eclipse的使用

    在软件开发领域,Eclipse是一款广泛使用的集成开发环境(IDE),尤其在Java开发中占据了重要的地位。本篇文章将深入探讨Eclipse的使用,包括Java项目开发流程、快捷键以及Junit单元测试工具的运用。 首先,创建一个...

    Java程序调试与错误收集--非代码引起的报错

    ### Java程序调试与错误收集——非代码引起的报错 在Java开发过程中,除了代码本身的错误之外,还有许多非代码因素可能会导致程序运行时出现问题。本文将深入探讨这些非代码因素引发的问题及其解决方法,帮助Java...

    jeecms源码级安装使用文档

    4. **集成开发环境(IDE)**:推荐使用Eclipse或IntelliJ IDEA等Java开发工具,便于代码管理和调试。 接下来是Jeecms的安装步骤: 1. **解压Jeecms源码**:下载并解压`jeecms-3.0.4-final-src.zip`,这将包含整个...

    java jdk安装向导

    ### Java JDK 安装与Eclipse集成指南 #### 一、前言 本文档旨在指导初学者如何正确安装Java Development Kit (JDK)并配置Eclipse集成开发环境(IDE),以便进行Java应用开发。JDK是Java编程语言的基础工具包,而...

    Java理论与实践:在JDK早期版本中使用Java 5的语言特性

    在本文中,我们将探讨如何在早期的JDK版本,如JDK 1.4中使用这些特性,以便开发人员可以在不升级JVM的情况下利用Java 5的优势。 首先,泛型允许开发者在代码中指定类型的约束,提高类型安全性和可读性。尽管泛型在...

Global site tag (gtag.js) - Google Analytics