Java RMI未找到java.sql.Statement的类定义

时间:2019-06-26 13:49:45

标签: java rmi

我正在Java 11 docker容器中运行用Kotlin编写的Spring boot应用程序。它是通过gradle run任务启动的。我想添加分析支持,因此添加了以下启动选项

    "-Dcom.sun.management.jmxremote",
    "-Dcom.sun.management.jmxremote.authenticate=false",
    "-Dcom.sun.management.jmxremote.ssl=false",
    "-Dcom.sun.management.jmxremote.port=34567",
    "-Dcom.sun.management.jmxremote.rmi.port=34567",
    "-Djava.rmi.server.hostname=0.0.0.0",

现在在日志中,我看到以下常规错误

Exception in thread "RMI TCP Connection(idle)" java.lang.NoClassDefFoundError: java/sql/Statement
at java.rmi/sun.rmi.transport.tcp.TCPConnection.close(TCPConnection.java:220)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:591)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

在gradle模块声明中,我具有以下模块

    "jdk.management",
    "jdk.management.rmi",
    "jdk.unsupported",
    "jdk.localedata",
    "java.instrument",
    "java.management",
    "java.sql",
    "java.rmi",
    "java.security.jgss",
    "java.desktop"

所以我不确定为什么找不到该类。我想知道如何解决这个问题。

0 个答案:

没有答案