Вопрос

My CORBA/Webstart application using an alternative ORB implementation (OpenORB) doesn't work with Java7u55 anymore.

The following exception occurs:

Error org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation org.openorb.CORBA.ORBSingleton  vmcid: 0x0  minor code: 0  completed: No
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation org.openorb.CORBA.ORBSingleton  vmcid: 0x0  minor code: 0  completed: No
    at org.omg.CORBA.ORB.create_impl_with_systemclassloader(Unknown Source)
    at org.omg.CORBA.ORB.init(Unknown Source)
    at org.openorb.CORBA.kernel.OpenORBLoader.init(Unknown Source)
    at org.openorb.CORBA.ORB.set_parameters(Unknown Source)
    at org.omg.CORBA.ORB.init(Unknown Source)
        ...
Caused by: java.lang.ClassNotFoundException: org.openorb.CORBA.ORBSingleton
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    ... 17 more

I think a a change in orb.omg.CORBA.ORB.init() is the reason the class for the ORB implementation wasn't found anymore as SystemClassLoader is used here now to create the ORB instance instead of current Thread's ContextClassLoader as before.

As a workaround I've copied the Jar containing org.omg.CORBA API of the ORB implementation I'm using to <jre-home>/lib/endorsed/ expecting that it will be used instead but still the implementation in rt.jar is used.

Any ideas how to work around this problem?

Это было полезно?

Решение

Finally I found a workaround which doesn't work for the currently used OpenORB but for JacORB (3.4).

Oracle obviously updated the release notes suggesting to configure only the org.omg.CORBA.ORBClass property but to ommit org.omg.CORBA.ORBSingletonClass which means the default singleton implementation shipped with Java will be used which is visible for the SystemClassLoader.

This may not work with all ORBs and in fact it doesn't work with OpenORB as it checks org.omg.CORBA.ORBSingletonClass but my application works without problems with the mentioned version of JacORB now.

Другие советы

there should be several workarounds:

  1. specify the following VM args when launching your app: -Djava.endorsed.dirs=/path/to/your/corba_library_jars_folder

  2. specify the following VM args when launching your app: -Xbootclasspath/p:/path/to/your/corba_lib.jar:/path/to/your/corba_lib2.jar:...

  3. copy your jars into $JAVA_HOME/jre/lib/endorsed directory (create it if it doesn't exist)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top