harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Kleymenov" <kleyme...@gmail.com>
Subject [vm] J9 system class loader issue
Date Thu, 04 May 2006 07:19:03 GMT
The classes loaded by the J9 system class loader have incorrect CodeSource
objects. Particularly the location URL of CodeSource object specifying the
place from where the class has been loaded has null value. To reproduce the
bug run the following test:

---------------------------- test.java ---------------------------
import java.security.CodeSource;
public class test {

    public static void main(String[] args) throws Exception {
        CodeSource cs = test.class.getProtectionDomain().getCodeSource();
        System.out.println("Host of code source location: '"
                + cs.getLocation().getHost() +"'");
    }
}
------------------------------------------------------------------

  The output of the test on J9 VM is:

Host of code source location: 'null'

  But RI prints the following:

Host of code source location: ''

  Empty string printed by RI corresponds to the 'localhost' value while null
value corresponds to undefined host.
  This issue causes incorrect processing of permissions granted by
security.policy file and it is one of the reasons of failure of the
following unit test placed in security module:

tests.api.java.security.PermissionCollectionTest

  Further investigations showed that incorrect URLs for CodeSource objects
are created in J9 internal class

at com.ibm.oti.vm.URLAppClassLoader.getClassPath(URLAppClassLoader.java:59)


Thank You,
Alexander Kleymenov

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message