harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Pervov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3074) [drlvm][classloader][jni] When FindClass is called from JNI_OnLoad function it cannot load user application classes
Date Mon, 29 Jan 2007 15:48:49 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468309
] 

Pavel Pervov commented on HARMONY-3074:
---------------------------------------

The idea of the fix is as follows: we should treat JNI_OnLoad as user's native function (required
by FindClass) and skip all "loadLibrary" frames:

        at java.lang.VMClassRegistry.loadLibrary(Native Method)
        at java.lang.Runtime.load0(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at Test.main(Test.java:5)

up to this one - i.e. 4 frames - and only then determine class loader of caller.



> [drlvm][classloader][jni] When FindClass is called from JNI_OnLoad function it cannot
load user application classes
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3074
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3074
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Priority: Minor
>         Attachments: JNI_OnLoad Test.zip
>
>
> I've created a program which has a native library and it has JNI_OnLoad function. When
this function tries to load a user application class via FindClass, loading attempt fails.
It looks like it happens because this class is attempted to be loaded with bootstrap class
loader which loads classes only from boot class path. So user class cannot be loaded since
it is not in boot class path.
> RI loads this user class with system application class loader.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message