温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

【Weblogic】java.lang.UnsupportedClassVersionError问题处理方案

发布时间:2020-08-14 04:58:40 来源:ITPUB博客 阅读:203 作者:neverinit 栏目:编程语言

开发人员对Java程序版本更新之后,重启Weblogic,发现java.lang.UnsupportedClassVersionError Unsupported major.minor version 51.0错误,主要错误信息如下:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pageCond': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.bocom.jump.bp.service.sqlmap.SqlMap com.bocom.training.jump.common.dao.BaseDao.sqlMap; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.bocom.feps.webservices.accounting.service.impl.QueryUniqueCodeServiceImpl] for bean with name 'queryUniqueCodeService' defined in class path resource [config/webservice-beans.xml]; nested exception is java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'com.bocom.feps.webservices.accounting.service.impl.QueryUniqueCodeServiceImpl'
……
Caused By: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.bocom.jump.bp.service.sqlmap.SqlMap com.bocom.training.jump.common.dao.BaseDao.sqlMap; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.bocom.feps.webservices.accounting.service.impl.QueryUniqueCodeServiceImpl] for bean with name 'queryUniqueCodeService' defined in class path resource [config/webservice-beans.xml]; nested exception is java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'com.bocom.feps.webservices.accounting.service.impl.QueryUniqueCodeServiceImpl'
……
Caused By: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.bocom.feps.webservices.accounting.service.impl.QueryUniqueCodeServiceImpl] for bean with name 'queryUniqueCodeService' defined in class path resource [config/webservice-beans.xml]; nested exception is java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'com.bocom.feps.webservices.accounting.service.impl.QueryUniqueCodeServiceImpl'
……
Caused By: java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'com.bocom.feps.webservices.accounting.service.impl.QueryUniqueCodeServiceImpl'
……
Caused By: java.lang.UnsupportedClassVersionError: com/bocom/feps/webservices/accounting/service/impl/QueryUniqueCodeServiceImpl : Unsupported major.minor version 51.0
……

经过查询MOS发现,该问题属于JDK冲突问题, 应用程序是使用JDK构建的,Weblogic环境中安装的JDK不支持该应用程序。 为避免异常,需要使用正确的JDK版本构建应用程序。

经与开发人员沟通,开发人员使用Weblogic环境中对应版本的JDK重新构建应用,然后更新之后问题顺利处理。


附MOS原文

UnsupportedClassVersionError: Unable to set the activation state to true for the application (文档 ID 2132881.1) 【Weblogic】java.lang.UnsupportedClassVersionError问题处理方案 转到底部 【Weblogic】java.lang.UnsupportedClassVersionError问题处理方案

【Weblogic】java.lang.UnsupportedClassVersionError问题处理方案

In this Document

GoalSolution


APPLIES TO:

Oracle WebLogic Server - Version 11.1.1.5.0 and later
Information in this document applies to any platform.

GOAL

UnsupportedClassVersionError exception when deploying new application on Weblogic server.

####<Feb 11, 2016 10:15:04 AM EST> <Error> <HTTP> <******> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1455203704171> <BEA-101165> <Could not load user defined filter in web.xml: ServletContext@6640065[app:*****_war module:******.war path:/****** spec-version:2.5] info.***.webapp.filters.PathFilter.
java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'info.***.webapp.filters.PathFilter'
......
java.lang.UnsupportedClassVersionError: info/***/webapp/filters/PathFilter : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:344)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:301)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:269)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:55)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:177)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:36)

 

SOLUTION

This is a JDK conflict issue.   The application is built with JDK that is not supported by the JDK installed in the Weblogic environment. To avoid the exception, please build your application with correct JDK version.


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI