[jacorb-developer] FYI - ORB classloader change in Java 7u55, Java 8u5 - Suggestions needed
Timothy Astle
timothy.astle at caris.com
Fri May 9 21:12:36 CEST 2014
http://hg.openjdk.java.net/jdk7u/jdk7u60/corba/rev/a8d27c3fc4e4
The change looks to be introduced into:
* Java 8 update 5
* Java 7 update 55
* Java 6 (looks like it was backported there too)
It appears that people are just starting to encounter this issue as they
update their JREs:
* https://java.net/jira/browse/GLASSFISH-21047
*
http://stackoverflow.com/questions/23225144/java-7u55-eclipse-system-fragment-classloader
It can affect web applications that are distributing JacORB within the
web application itself. Oracle changed the classloader that searches
for the ORBSingletonClass, so now the implementation class must be on
the System classpath, not the web application's classpath, else the JRE
will not find the implementation. You can see how this applies to
servlet containers here:
http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
People will most likely see this exception when it is encountered:
Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB
implementation com.sun.corba.ee.impl.orb.ORBSingleton vmcid: 0x0 minor
code: 0 completed: No
at org.omg.CORBA.ORB.create_impl_with_systemclassloader(ORB.java:309)
at org.omg.CORBA.ORB.init(ORB.java:294)
I was in contact with the committer from Oracle today. He says this is
not a bug, but they admit that the documentation on the change was poor
and they've been getting a fair amount of issues filed about it in their
bug database (http://bugs.java.com). I believe they aim on remedying this.
So I'm left with a question to the experienced JacORB developers:
Is there a way that I can distribute JacORB within a WAR file and have
it work given the breaking change in the JRE? I was basically just
doing this:
Properties props = new Properties();
props.setProperty("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
props.setProperty("org.omg.CORBA.ORBSingletonClass",
"org.jacorb.orb.ORBSingleton");
org.jacorb.orb.ORB orb = (org.jacorb.orb.ORB)
org.omg.CORBA.ORB.init(args, props);
I know the JacORB docs always mention supplying the ORB to the
bootclasspath (http://www.jacorb.org/TomcatHowto.html), but I didn't
seem to have any problems just bundling it into the WAR itself.
Any tips would be appreciated,
--
Tim Astle
More information about the jacorb-developer
mailing list