Classloader issues

Poster Content
nk4um Administrator
Posts: 607
March 3, 2006 14:03getPackage() now implemented
The NetKernel classloader now properly implements getPackage() by returning
Packages for all classes which are loaded.

Rigel has tested this update with BIRT and confirms all is happy. This update will appear in NetKernel 3.0 final release.

Cheers,
Tony
Like · Post Reply
nk4um Administrator
Posts: 607
February 15, 2006 17:06getPackage() not implemented
Yes you are right. getPackage() isn''t implemented on any of the NetKernel classloaders. We haven''t seen a library that has needed it to date so well found!

I''ll take a look at what it takes to implement it and get back to you.

Cheers,
Tony
Like · Post Reply
nk4um User
Posts: 4
February 15, 2006 15:22Classloader issues
Hello,

I would like to have your opinion on some classloader issues, that I''ve found with NK.

I''m trying to integrate BIRT (http://www.eclipse.org/birt/phoenix/) into NK. I had a working example of BIRT running in the command line, but when I tried to build an acessor to this example, it blew up with an NPE.

After some serious digging into the source code of BIRT. I''ve found the following line.

public SomeClass {
    private String packageName = SomeClass.class.getPackage().getName();
}

Apparently this line works with the default classloader from the JVM but not with NK. The problem is in the getPackage() method call, a responsability of the current classloader and that returns null with NK.

The forums of BIRT see this as a classloader bug, (because it runs in the JVM) but the truth is that the getPackage() method in the Java API doesn''t make it mandatory, that a package must be returned, it can be null. So I see this as a grey area of responsability, but the consequences are that I can not integrate the two frameworks in a clean way, without changing some internal code that is...

What are you thoughts on this ?
Like · Post Reply