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

时间:2019-03-11 22:55:06

标签: jndi corba 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");
}

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

将客户端升级到JDK 11后,我立即遇到以下错误。这是可以预期的,因为corba jars已从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);

Stacktrace

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罐子吗?
  2. 我认为JNDI查找的标准J2EE功能应该起作用。 Weblogic 10.3.6是否与JDK 11客户端不兼容?

非常感谢您的帮助。

0 个答案:

没有答案