Java 11 升级:java.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity
Posted
技术标签:
【中文标题】Java 11 升级:java.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity【英文标题】:Java 11 upgrade: java.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity 【发布时间】:2021-11-07 16:06:46 【问题描述】:我正在努力将 Java 组件升级到 Java 11,但遇到了运行时错误。 Java 组件构建成功但出现此错误:java.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity
when try to smoke test service。
经过一番研究,我发现 Java 11 不支持 CORBA,我需要从外部下载 GlassFish CORBA JAR 文件 http://support.sas.com/kb/63/716.html
我也尝试添加 glassfish 依赖项,就像第二个答案 Is there a replacement library for CORBA in JDK 11 中提到的那样,但仍然是同样的错误。
我下载了 glassfish jar 并将它们指向 .bash_profile 中的 CLASSPATH
export CLASSPATH=$CLASSPATH:/usr/local/glassfish-corba-internal-api-4.2.4.jar:/usr/local/glassfish-corba-omgapi-4.2.4.jar:/usr/local/glassfish-corba-orb-4.2.4.jar:/usr/local/pfl-basic-4.1.2.jar:/usr/local/pfl-tf-4.1.2.jar
这是完整的错误日志:
21/11/07 15:52:39.865 GMT INFO [qtp1201454821-16] com.cerner.pophealth.bi.bodsp.service.lib.serviceclients.AnalyticsBiDirectoryServiceClient [cid:fa29ac1a-f394-44a5-abed-4055cf966362] Retrieving info from BI Directory Service for tenant 50187c3d-b72c-4f7a-9a34-b2abe35be868\n
21/11/07 15:52:41.726 GMT INFO [qtp1201454821-16] com.cerner.pophealth.bi.bodsp.service.lib.serviceclients.AnalyticsBiDirectoryServiceClient [cid:fa29ac1a-f394-44a5-abed-4055cf966362] Retrieving info from BI Directory Service for cluster 1ac5c9a5-4fca-4eb5-a5a8-9e73d53a1871\n
21/11/07 15:52:42.463 GMT INFO [qtp1201454821-16] com.cerner.pophealth.bi.bodsp.service.handlers.SessionUtil [cid:fa29ac1a-f394-44a5-abed-4055cf966362] Opening session to CMS: boapp1.northamerica.cerner.net\n
21/11/07 15:52:42.679 GMT ERROR [qtp1201454821-16] com.cerner.beadledom.jaxrs.exceptionmapping.ThrowableExceptionMapper [cid:fa29ac1a-f394-44a5-abed-4055cf966362] An unhandled exception was thrown.\njava.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity\n at java.base/java.lang.ClassLoader.defineClass1(Native Method)\n at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)\n at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)\n at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)\n at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)\n at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)\n at java.base/java.security.AccessController.doPrivileged(Native Method)\n at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)\n at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass(WebAppClassLoader.java:642)\n at org.eclipse.jetty.webapp.WebAppClassLoader.loadAsResource(WebAppClassLoader.java:615)\n at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:529)\n at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)\n at java.base/java.lang.ClassLoader.defineClass1(Native Method)\n at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)\n at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)\n at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)\n at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)\n at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)\n at java.base/java.security.AccessController.doPrivileged(Native Method)\n at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)\n at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass(WebAppClassLoader.java:642)\n at org.eclipse.jetty.webapp.WebAppClassLoader.loadAsResource(WebAppClassLoader.java:615)\n at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:529)\n at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)\n at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initializeDefaultPolicies(ORB_impl.java:369)\n at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initialize(ORB_impl.java:196)\n at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.setParameters(ORB_impl.java:812)\n at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.init(ORB_impl.java:1313)\n at com.crystaldecisions.enterprise.ocaframework.idl.helper.ORBHelper.init(ORBHelper.java:57)\n at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.<init>(ServiceMgr.java:402)\n at com.crystaldecisions.enterprise.ocaframework.ServiceMgrFactory.getServiceMgr(ServiceMgrFactory.java:66)\n at com.crystaldecisions.sdk.occa.security.internal.LogonService.ensureServiceStub(LogonService.java:646)\n at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:829)\n at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:806)\n at com.crystaldecisions.sdk.occa.security.internal.LogonService.userLogon(LogonService.java:211)\n at com.crystaldecisions.sdk.occa.security.internal.SecurityMgr.userLogon(SecurityMgr.java:166)\n at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody0(SessionMgr.java:458)\n at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody1$advice(SessionMgr.java:521)\at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon(SessionMgr.java:1)\n at com.cerner.pophealth.bi.bodsp.service.handlers.SessionUtil.openSession(SessionUtil.java:100)\n at com.cerner.pophealth.bi.bodsp.service.handlers.ServiceProvider.<init>(ServiceProvider.java:47)\n at com.cerner.pophealth.bi.bodsp.service.resource.BODSPResourceImpl.getBODSPHandler(BODSPResourceImpl.java:237)\n at com.cerner.pophealth.bi.bodsp.service.resource.BODSPResourceImpl.getBODSPs(BODSPResourceImpl.java:71)\n at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.base/java.lang.reflect.Method.invoke(Method.java:566)\n at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:138)\n at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:517)\n at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:406)\n at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:370)\n at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)\n at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:372)\n at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:344)\n at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:317)\n at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:440)\n at org.jboss.resteasy.core.AsynchronousDispatcher.invoke(AsynchronousDispatcher.java:312)\n at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:229)\n at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:135)\n at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)\n at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:138)\n at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:215)\n at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)\n at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)\n at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)\n at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)\n at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)\n at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)\n at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)\n at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)\n at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)\n at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)\n at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\n at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)\n at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)\n at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)\n at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)\n at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)\n at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)\n at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n at org.eclipse.jetty.webapp.logging.ContextLogHandler.handle(ContextLogHandler.java:64)\n at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n at org.eclipse.jetty.server.Server.handle(Server.java:516)\n at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)\n at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)\n at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)\n at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)\n at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)\n at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)\n at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)\n at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)\n at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)\n at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)\n at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:137)\n at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)\n at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)\n at java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: java.lang.ClassNotFoundException: org.omg.CORBA.portable.IDLEntity\n at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)\n at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)\n at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)\n at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:538)\n at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)\n ... 102 common frames omitted\n
172.17.0.1 - - [21/11/07 15:52:42.738 GMT] "GET /data-security-profiles?tenantId=50187c3d-b72c-4f7a-9a34-b2abe35be868 HTTP/1.1" 500 64 "-" "PostmanRuntime/7.28.3" "localhost:8080" "-" "fa29ac1a-f394-44a5-abed-4055cf966362"
【问题讨论】:
【参考方案1】:根据您的示例类路径,我假设您在构建过程中没有使用依赖管理系统。
使用一个可以消除您错误输入类路径或忘记临时依赖项的可能性,这两者似乎都可能是罪魁祸首。
Java 最常用的依赖管理工具是 Gradle 和 Maven。
【讨论】:
通过 'mvn install:install-file \ -Dfile=C:/CR-Libs/ebus405.jar \ -DgroupId='com.crystaldecisions' \ 将 ebus405.jar 安装到我的本地 Maven 仓库后-DartifactId='ebus405' \ -Dversion=1.0 \ -Dpackaging=jar \ -DgeneratePom=true 然后包含依赖以上是关于Java 11 升级:java.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity的主要内容,如果未能解决你的问题,请参考以下文章
运行使用 maven 构建的 jar 时的 FlinkMLTools NoClassDef