FULL PRODUCT VERSION :
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Service provider for the interface java.util.prefs.PreferencesFactory can not be found with non-system classloader.
For example, custom preferences service provider can not be deployed with web application.
The reason of this problem is in the method factory1() in class java.util.prefs.Preferences. It uses only ClassLoader.getSystemClassLoader() to find service provider class.
For example, the method factory() in the same class try to use both ClassLoader.getSystemClassLoader() and Thread.currentThread().getContextClassLoader().
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
It is possible to set system property "java.util.prefs.PreferencesFactory" pointing to necessary custom PreferencesFactory. But it seems to me this method is not admissible in servers with many applications deployed.
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Service provider for the interface java.util.prefs.PreferencesFactory can not be found with non-system classloader.
For example, custom preferences service provider can not be deployed with web application.
The reason of this problem is in the method factory1() in class java.util.prefs.Preferences. It uses only ClassLoader.getSystemClassLoader() to find service provider class.
For example, the method factory() in the same class try to use both ClassLoader.getSystemClassLoader() and Thread.currentThread().getContextClassLoader().
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
It is possible to set system property "java.util.prefs.PreferencesFactory" pointing to necessary custom PreferencesFactory. But it seems to me this method is not admissible in servers with many applications deployed.