Community
Participate
Working Groups
Build Identifier: 3.7.0.v20110613 When working with Apache Aries in an environment running on an IBM J9 JVM, the 'class data sharing' adapter for eclipse is returning a shared class cache token to the framework out of a class loading hook. The token is then getting passed to the OSGi weaving hooks where the weavers are falling because the class bytes are invalid. Perhaps there should be a mechanism where the framework attempts to verify that the byte code returned from load hook has a proper byte code magic of 'CAFEBABE' before passing it to the weaving hooks? Reproducible: Always Steps to Reproduce: 1. Run equinox on an IBM JDK with the CDS framework extension 2. Enable a weaving hook 3. Note that the weaving hook does not get class bytes by the shared class cache token
Created attachment 205941 [details] Possible fix Here is a possible fix that ensures the weaving hooks get the actual bytes of the real .class file. This patch assumes that BundleEntry.getInputStream() will always return the actual bytes of the real .class file. Where getBytes() returns the byte[] to the magic share classes key to be used when defining a class that is a shared class. The patch detects that the value returned by BundleEntry.getBytes is not a valid class file and will get the real bytes from BundleEntry.getInputStream().
A fix was released in the commit: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=609c7b5ae81f664920ccfe09d0b8d59cab098791