Make Java 6, Mac OS X and Weblogic work together
As many of you know, Apple hates Java. They delayed release of Java 6 on Mac for a year and a half. When Snow Leopard hit stores last fall, another inconvenient thing happened: Java 5 was removed from the OS. And there is no official way to bring it back. The solution was to get packed Java 5 directory tree from Leopard OS, unpack it and add a couple of symlinks, but it is definitely not the option for mere users. Since our application uses Java 5 (mostly because it relies on Weblogic 9), we needed to make it work on Java 6.
A couple of problems have arisen. Weblogic Server 9 that we use doesn't support Java 6. We let it to run on Java 5 on the server and so only needed to make client application work with Java 6. It still pose some problems.
First, Weblogic custom serialization is broken. It relies on a bug in ClassLoader, which existed in Java 5, but was fixed in Java 6. Hopefully, a workaround exists: set sun.lang.ClassLoader.allowArraySyntax property to true before JVM has started. Unfortunately, we can't do that: our application is run using JavaWebStart and the property is not in the list of "safe" properties which can be set in .jnlp descriptor and used by VM, setting the property programmatically after application has started has no effect. The solution was to get JDK sources, find a field this value is stored at (surprisingly, it is private field sun.misc.VM.allowArraySyntax) and set the field to true using reflection.
Second, Weblogic 9 & 10 prior to version 10.3.1 doesn't support certificates signed with SHA256withRSA (1, 2). Newer versions of JDK contain such certificates starting from JDK 5u17 and 6u13. You're miserable if you have Weblogic 9, cause patch is only available per support contract which is, you know, expensive. Funny thing is, the patch doesn't solve the certificates problem fully. Fortunately, we already create custom keystore from system certificates, so we just need to filter those certificates with SHA256withRSA algorithm.
Third, previously we only allowed the app to run on Java 5. That was expressed as <j2se version="1.5*" ...> in .jnlp file. Just replace it with <j2se version="1.5+" ...>. This way the app can use either JDK 5 or JDK 6. More on Apple Java version strings here.
Hope it'll save you a couple of days debugging.