gpt4 book ai didi

jndi - 从 JDK 11 客户端到 Weblogic 10.3.6 (JDK 7) 服务器的简单 JNDI 查找不起作用

转载 作者:行者123 更新时间:2023-12-05 00:47:47 32 4
gpt4 key购买 nike

服务器环境:Weblogic 10.3.6、JDK 1.7

我有一个使用 JDK 7 运行的简单 Java SE 客户端应用程序。在客户端,我正在对上面提到的资源托管服务器进行非常简单的 JNDI 外观。

ClassPath 中的 jar : wlthint3client.jar

public static void main(String[] args) throws Exception {
Hashtable t = new Hashtable();
t.put(InitialContext.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
t.put(InitialContext.PROVIDER_URL, "t3://localhost:7003/");
InitialContext ic = new InitialContext(t);

String jndiName = "weblogic.jdbc.DataSource.Workflow";

Object obj = ic.lookup(jndiName);
System.out.println("Found it");
}

我必须升级我的工作 Java SE 客户端应用程序从 JDK 7 到 JDK 11。服务器环境保持不变。

当我将客户端升级到 JDK 11 时,我遇到了以下错误。这是预期的,因为 corba jar 已从 JDK 11 中移出。

Exception in thread "main" java.lang.NoClassDefFoundError: org/omg/CORBA/SystemException
at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:202)
at weblogic.jndi.spi.EnvironmentManager$DefaultFactoryMaker.<clinit>(EnvironmentManager.java:27)
at weblogic.jndi.spi.EnvironmentManager.getInstance(EnvironmentManager.java:49)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
at com.test.JndiLookupTestJdk11.main(JndiLookupTestJdk11.java:16)

添加 jacorb-omgapi-3.8.jar 到客户端类路径以修复上述异常。

在此之后,我遇到了超时异常并且没有给出任何线索。服务器已启动并正在运行,因为我的旧客户端正在运行。

错误在这一行

InitialContext ic = new InitialContext(t);

堆栈跟踪

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by weblogic.rjvm.MsgAbbrevInputStream (file:/C:/Users/ke64/OneDrive%20-%20Sun%20Life%20Financial/work_eclipse-jee-2018-12-R/jndi-lookup-test-jdk11/lib/wlthint3client.jar) to method java.io.ObjectInputStream.clear()
WARNING: Please consider reporting this to the maintainers of weblogic.rjvm.MsgAbbrevInputStream
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7003: Bootstrap to: localhost/0:0:0:0:0:0:0:1:7003' over: 't3' got an error or timed out]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:792)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:368)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
at com.test.JndiLookupTestJdk11.main(JndiLookupTestJdk11.java:16)
Caused by: java.net.ConnectException: t3://localhost:7003: Bootstrap to: localhost/0:0:0:0:0:0:0:1:7003' over: 't3' got an error or timed out
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:165)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:353)
... 8 more
Caused by: java.rmi.ConnectException: Bootstrap to: localhost/0:0:0:0:0:0:0:1:7003' over: 't3' got an error or timed out
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:365)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:260)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteCluster(RJVMFinder.java:316)
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:205)
... 11 more

问题

  1. 有没有人使用配置?任何想法如何解决这个问题?我是否需要添加任何特定版本的 corba jar?
  2. 我认为 JNDI 查找的标准 J2EE 功能应该可以工作。 Weblogic 10.3.6 与 JDK 11 客户端不兼容吗?

非常感谢任何帮助。

最佳答案

没有可在 JDK 11 上运行的 WebLogic Server 发布版本。WLS 10.3.6 甚至还没有接近(它甚至在 JDK 8 上都不起作用)。

最接近的发布版本是 WLS 12.2.1.3.0,它在 JDK9 上几乎可以工作,但随着 JDK 10 和 JDK 11 的后续更改而被破坏。

计划在 2019 年下半年推出通过 JDK 11 认证的 WebLogic Server 版本。

关于jndi - 从 JDK 11 客户端到 Weblogic 10.3.6 (JDK 7) 服务器的简单 JNDI 查找不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55111590/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com