是否可以使用 Java 1.5 通过客户端调用在 Java 1.4 上运行的 EJB?

发布于 2024-10-10 00:12:51 字数 199 浏览 0 评论 0原文

我们有一种情况,我们不想更改在 Java 1.4 上运行的服务器 JVM。但客户端使用的是 Java 1.5,并且我们在调用 EJB 时遇到异常。我们不确定这是我们的应用程序问题还是 EJB 服务器-客户端 JVM 兼容性问题。

We have one scenario where we don't want to change the server JVM which is running on Java 1.4. But the client is using Java 1.5, and we are getting exceptions while calling the EJB. We are not sure whether it's our application issue or an EJB server-client JVM compatibility issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三寸金莲 2024-10-17 00:12:51

您处理前向兼容性 (FC),因为您尝试在旧服务器 (1.4) 上运行新客户端 (1.5)。 Java不保证FC。它只是保证向后兼容性 (BC),如 自 1.4.2 以来 J2SE 5.0 中的不兼容性中所述(www.oracle.com 上的镜像) :

JDK 5.0 与 Java 2 SDK v1.4.2 向上二进制兼容,但下面列出的不兼容性除外。这意味着,除了指出的不兼容性之外,使用版本 1.4.2 编译器构建的类文件将在 JDK 5.0 中正确运行。

注意:Sun 文档编写者将术语向后兼容性称为向上兼容性(他们将其描述为“使用版本 1.4.2 编译器构建的类文件将跑步
在 JDK 5.0 中正确”),但这是一个错误,因为:向后==向下 (wiki) 和向前==向上 (wiki)。

You deal with forward compatibility (FC) because you are trying to run new client (1.5) with old server (1.4). Java is not guarantee FC. It's just guarantee backward compatibility (BC) as described in Incompatibilities in J2SE 5.0 since 1.4.2 (mirror at www.oracle.com):

JDK 5.0 is upwards binary-compatible with Java 2 SDK, v1.4.2 except for the incompatibilities listed below. This means that, except for the noted incompatibilities, class files built with version 1.4.2 compilers will run correctly in JDK 5.0.

Note: Sun documentation writers call the term backward compatibility as upward compatibility (they describe it as "class files built with version 1.4.2 compilers will run
correctly in JDK 5.0") , but this is a mistake, because: backward==downward (wiki) and forward==upward (wiki).

写给空气的情书 2024-10-17 00:12:51

不确定这是否会影响您正在做的事情...

但是您可以让 EJB 3 与 EJB 2 进行对话。但是您必须采用 EJB 2 风格的通信。因此,在使用 Java 1.5 的情况下,您可能需要确保客户端在 EJB 2 样式查找中查找 EJB 2(或 2.1,因为您是 JDK 1.4)。

Not sure if this plays into what you are doing or not....

But you can get EJB 3's to talk to EJB 2's. However you have to do the communication EJB 2 style. So in your case with Java 1.5, you may need to make sure the client is looking up the EJB 2 (or 2.1 since you are JDK 1.4) in EJB 2 style lookup's.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文