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

Rak*_*ati 1 corba jndi weblogic11g java-11

服务器环境:Weblogic 10.3.6,JDK 1.7

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

ClassPath 中的罐子: 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");
}
Run Code Online (Sandbox Code Playgroud)

我必须我的工作 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)
Run Code Online (Sandbox Code Playgroud)

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

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

错误在这一行

InitialContext ic = new InitialContext(t);
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪

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
Run Code Online (Sandbox Code Playgroud)

问题

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

任何帮助是极大的赞赏。

Ste*_*lts 6

没有适用于 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 版本。

  • 2020 年 3 月底发布的 WLS 14.1.1.0.0 支持 JDK8 和 JDK11。 (2认同)