[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] j9 class sharing and CL.getResource

I have experienced similar issues, both with a shared classes adaptor and a jxe adaptor on j9. In both cases the issue can be worked around by doing different things with the BundleEntry#getBytes() and BundleEntry#getInputStream methods. The getBytes() method is only used by the classloader to get the byte[] to define the class. This is where the "magic bytes" with the identifier used by j9 class sharing should be returned. The getInputStream is used by the URLs CL.getResource. In your adaptor you can implement getInputStream to read the real bytes out of the content of the bundle instead of using the shared classes cache bytes. This should allow you to get the real bytes of the class file.



Inactive hide details for Martin Lippert ---03/03/2008 03:09:58 PM---Hi!Martin Lippert ---03/03/2008 03:09:58 PM---Hi!


Martin Lippert <lippert@xxxxxxx>


Equinox Project <equinox-dev@xxxxxxxxxxx>


03/03/2008 03:09 PM


[equinox-dev] j9 class sharing and CL.getResource


I have a question regarding J9 class sharing and the adaptor hooks: I
have an adaptor hook that uses specialized bundle file objects to
delegate to the j9 class sharing. This implementation is done for all
path parameters that end with ".class".

Now a library that I use calls CL.getResource for a class file to get
the bytecode of that class. In the case of j9 class sharing this call
returns just some identifier used by j9 class sharing instead of the
real bytecode.

Did you observe similar problems with j9 class sharing? Do you have any
idea how to solve this?

Thanks for your help!!!

Best regards,

equinox-dev mailing list

GIF image

GIF image