• Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassLoaders and Permissions!  RSS feed

 
Kaushik Sathupadi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose, a class 'package1.Class1' is loaded using a new classloader, it by default cannot access another classes in "package1" having "default" access. Is there anyway to grant this permission.

Note 1: package1.Class1 will not access othere class in package1 using reflection. It will access them directly. like for eg.,
package1.A = new package1.A() [ where class 'A' has default access ]


Note 2: I've even tried giving ALLPERMISSION in .java.policy file. however it always throws a java.lang.IllegalAccessError: tried to access class <cls1> from class 'package1.Class1'. Why does this happen?
 
Jim Noriega
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you must load that class with the new class loader.

All classes are really defined as:

ClassLoader : package : classname
[ December 14, 2006: Message edited by: Jim Noriega ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!