Details
-
Type: Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.1
-
Component/s: None
-
Labels:None
Description
We are running on JRockit 8.1 1.41_05 and it is trying detect the Sun JVM but it is getting an java.lang.UnsatisfiedLinkError which isn't being caught so the pure java impl is not being used.
Could you add
} catch (java.lang.UnsatisfiedLinkError e)
to the catch block in bestReflectionProvider().
Thanks, Hal
java.lang.UnsatisfiedLinkError: registerNatives
at sun.misc.Unsafe.registerNatives()V(Native Method)
at sun.misc.Unsafe.<clinit>()V(Unsafe.java:28)
at COM.jrockit.vm.Classes.forName0(Ljava.lang.String;ZI)I(Native Method)
at COM.jrockit.vm.Classes.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)
at java.lang.Class.forName(Ljava.lang.String;I)Ljava.lang.Class;(Unknown Source)
at com.thoughtworks.xstream.core.JVM.loadClass(Ljava.lang.String;)Ljava.lang.Class;(JVM.java:21)
at com.thoughtworks.xstream.core.JVM.bestReflectionProvider()Lcom.thoughtworks.xstream.converters.reflection.ReflectionProvider;(JVM.java:33)
at com.thoughtworks.xstream.XStream.<init>()V(XStream.java:106)
While this is caused by JRockit incorrectly throwing a ClassDefNotFoundError (ie a LinkageError) instead of a ClassNotFoundException, it would seem safe and reasonable to handle any LinkageError that is thrown by Returning a PureJavaReflectionProvider.