Class loading error when looking up security providers

Paul Sandoz paul.sandoz at oracle.com
Wed Jun 13 08:55:18 PDT 2012


On Jun 13, 2012, at 5:10 PM, Sean Mullan wrote:

> 
> On 6/13/12 9:58 AM, Paul Sandoz wrote:
>> Hi Sean,
>> 
>> Looking at the code the problem is the class "com.sun.crypto.provider.SunJCE" is in the jdk.crypto module and the code to load crypto providers does:
>> 
>>                    ClassLoader cl;
>>                    if (Platform.isModuleMode()) {
>>                        cl = Platform.getBaseModuleLoader();
>>                    } else {
>>                        cl = ClassLoader.getSystemClassLoader();
>>                    }
>>                    Class<?> provClass;
>>                    if (cl != null) {
>>                        provClass = cl.loadClass(className);
>>                    } else {
>>                        provClass = Class.forName(className);
>>                    }
>> 
>> So it is using the CL of the jdk.base module, which cannot see classes from the jdk.crypto module.
>> 
>> As the comment in the source that occurs above the above snippet states, this area needs to start using services.
> 
> Ok, but I need a workaround for the time-being. If you think of anything, let me
> know.
> 

Hmm... you might be able to muck around with the platform library and copy the classes from the jdk.crypto location into the jdk.base location then refresh the library.

Paul.


More information about the jigsaw-dev mailing list