Java 已找到类字节,但在部署 EAR 时defineClass() 因错误而失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23771470/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:08:13  来源:igfitidea点击:

Class bytes found but defineClass()failed for error when deploying EAR

javajakarta-eeejbweblogic

提问by

I am trying to deploy and old code base with EJB 1.1 stuff to Weblogic 10.3.6 and keep getting this strange error Class bytes found but defineClass()failed for.

我正在尝试将带有 EJB 1.1 内容的旧代码库部署到 Weblogic 10.3.6 并不断收到这个奇怪的错误Class bytes found but defineClass()failed for

The classes are there and being found what is causing this?

课程在那里,被发现是什么原因造成的?

采纳答案by

This is here, because this was a hard thing to find on the internet.

这是在这里,因为这在互联网上很难找到。

I figured it out, the project was getting compiled with JDK 1.7 and the Weblogic server has 1.6 installed.

我想通了,该项目正在使用 JDK 1.7 进行编译,并且 Weblogic 服务器安装了 1.6。

I recompiled the project with JDK 1.6 and it is working now!

我用 JDK 1.6 重新编译了该项目,现在可以正常工作了!

回答by Mohit

Problem:

问题

Compiling code with JDK 1.7 Running code with Weblogic server with JDK 1.6

使用 JDK 1.7 编译代码使用 JDK 1.6 使用 Weblogic 服务器运行代码

Solution 1: Compile code with JDK 1.6

解决方案 1:使用 JDK 1.6 编译代码

Solution 2: Run weblogic server with JDK 1.7

解决方案 2:使用 JDK 1.7 运行 weblogic 服务器

Update (Middleware)\user_projects\domains(DomainName)\bin\setDomainEnv.cmd (Windows)

更新(中间件)\user_projects\domains(DomainName)\bin\setDomainEnv.cmd (Windows)

Update (Middleware)\user_projects\domains(DomainName)\bin\setDomainEnv.sh (*nix)

更新(中间件)\user_projects\domains(DomainName)\bin\setDomainEnv.sh (*nix)

set SUN_JAVA_HOME= JDK 1.7 path (e.g C:\Program Files\Java\jdk1.7.0_79)

设置 SUN_JAVA_HOME= JDK 1.7 路径(例如 C:\Program Files\Java\jdk1.7.0_79)

set JAVA_HOME= JDK 1.7 path (e.g C:\Program Files\Java\jdk1.7.0_79)

设置 JAVA_HOME= JDK 1.7 路径(例如 C:\Program Files\Java\jdk1.7.0_79)