gpt4 book ai didi

java - 如何诊断 JBoss IIOP Stub 生成、类加载问题?

转载 作者:行者123 更新时间:2023-11-29 05:49:19 24 4
gpt4 key购买 nike

我正在将一个在 JBoss 6.1 上运行的已有 10 年历史的 EJB2 应用程序从 JNP 协议(protocol)迁移到 CORBA RMI/IIOP,因为我想使用 ORB PortableInterceptor。

首先 JBoss 提示 org.jboss.iiop.rmi.RMIIIOPViolationException 我现在已经修复了。

现在 JBoss 的 WebCL servlet 无法将我的 Home 和 Remote 接口(interface)的 stub 传送到客户端,我不知道可能出了什么问题。我唯一剩下的假设是 RMIC 编译器会自动失败。我收到的唯一错误消息是

2013-01-29 09:33:52,068 ERROR [org.jboss.iiop.WebCL] (pool-2-thread-1) failed finding class my.test.services.orb._Business1SLHome_Stub: org.jboss.util.NestedRuntimeException: - nested throwable: (java.lang.ExceptionInInitializerError)
at org.jboss.iiop.WebCL.findClass(WebCL.java:124) [:6.1.0.Final]
at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [:1.6.0_31]
at org.jboss.classloading.spi.DelegatingClassLoader.loadClass(DelegatingClassLoader.java:82) [jboss-classloading-spi.jar:6.0.0.CR1]
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [:1.6.0_31]
at org.jboss.web.WebServer.run(WebServer.java:393) [:6.1.0.Final]
at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) [:2.0.0.CR7]
at org.jboss.threads.CleanupExecutor.execute(CleanupExecutor.java:38) [:2.0.0.CR7]
at org.jboss.threads.CleanupExecutor.execute(CleanupExecutor.java:38) [:2.0.0.CR7]
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:801) [:2.0.0.CR7]
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45) [:2.0.0.CR7]
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:821) [:2.0.0.CR7]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_31]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:2.0.0.CR7]
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_31]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_31]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_31]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_31]
at java.lang.Class.newInstance0(Class.java:355) [:1.6.0_31]
at java.lang.Class.newInstance(Class.java:308) [:1.6.0_31]
at org.jboss.iiop.WebCL.findClass(WebCL.java:120) [:6.1.0.Final]
... 12 more
Caused by: java.lang.RuntimeException: Error loading class my.test.services.orb.Business1Remote: java.lang.ClassNotFoundException: my.test.services.orb.Business1Remote from BaseClassLoader@3cdf0256{asynch-classloader:0.0.0$MODULE}
at org.jboss.iiop.rmi.marshal.CDRStream.readerFor(CDRStream.java:208) [:6.1.0.Final]
at org.jboss.iiop.rmi.marshal.strategy.StubStrategy.<init>(StubStrategy.java:175) [:6.1.0.Final]
at org.jboss.iiop.rmi.marshal.strategy.StubStrategy.forMethod(StubStrategy.java:115) [:6.1.0.Final]
at my.test.services.orb._Business1SLHome_Stub.$i2(Unknown Source)
at my.test.services.orb._Business1SLHome_Stub.<clinit>(Unknown Source)
... 19 more

我应该如何继续获取此类加载失败的原因并修复它?

最佳答案

我一直在这样做:

  1. 在jboss 上启用远程调试
  2. 将调试器(例如 eclipse 调试器)连接到 JBoss 实例
  3. 定义断点以捕获任何 ClassNotFoundExceptions
  4. 激活码
  5. 遇到断点时,检查使用的类加载器并查看已加载类的列表,这应该可以提供类加载失败原因的线索

即使编译器可以工作,也可能是类加载器对相关类不可见。

关于java - 如何诊断 JBoss IIOP Stub 生成、类加载问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14583213/

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