1

I am migrating a ten years-old EJB2 application running on JBoss 6.1 from JNP protocol to CORBA RMI/IIOP because I want to use ORB PortableInterceptor.

First JBoss complains with org.jboss.iiop.rmi.RMIIIOPViolationException I have now fixed.

Now JBoss' WebCL servlet fails to deliver Stub for my Home and Remote interfaces to the client and I have no idea what may be wrong. My only remaining hypothesis is that the RMIC compiler fails silently. The only ERROR message I get is

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

How should I proceed to get the cause of this class loading failure and fix it ?

Yves Martin
  • 10,217
  • 2
  • 38
  • 77

2 Answers2

2

I've been doing this:

  1. Enable remote debugging on jboss
  2. Connect a debugger (such as eclipse debugger) to JBoss instance
  3. Define a breakpoint to catch any ClassNotFoundExceptions
  4. Activate the code
  5. When the breakpoint is hit, examine the used classloader and see what the list of loaded classes look like, which should give clues as to why class loading is failing

Even if the compiler works, it might be that classloader has not the visibility to class(es) in question.

eis
  • 51,991
  • 13
  • 150
  • 199
  • Not a so bad idea BUT... there are a lot of ClassNotFoundException thrown, re-thrown and finally caught silently... And I have not seen my EJB class name yet. – Yves Martin Jan 30 '13 at 15:20
  • you can add a conditional breakpoint, too, if that's the way. though lot of classnotfoundexceptions sounds bad to me... – eis Jan 30 '13 at 17:50
  • it may sound bad... but that is the way JBoss works internally (or even JVM). By the way, as I do not know where to look at, it is difficult to define a relevant filter on such a break point. – Yves Martin Jan 31 '13 at 07:23
  • well, the exception trace says it's occurring in `org.jboss.iiop.rmi.marshal.CDRStream` package. On Eclipse, you can right click -> breakpoint properties -> Filtering -> Add Package... and check. However I guess you need to have JBoss sources loaded for the package to be visible in that dialog. That can be done, too, as they are downloadable [from git](https://github.com/jbossas/jboss-as). – eis Jan 31 '13 at 08:48
1

The root cause is that the named Business1Remote class wasn't found. See the stack trace. Did you deploy it to the client?

user207421
  • 305,947
  • 44
  • 307
  • 483
  • The Business1Remote interface is available in client classpath. Remind, the application already works with JNP protocol ! It is also available in "DefaultDomain" ClassLoader... But WebCL classloader cannot find it ? – Yves Martin Jan 29 '13 at 16:25