I use a javaagent that does bytecode instrumentation. This injected code needs to be able to see its runtime dependency, which is available from the boot classloader.
JBoss appears to ignore the "org.osgi.framework.bootdelegation" property, which was, as far as I can tell, the way you're supposed to solve this problem. I can't find any documentation on this subject.
If anyone knows how to accomplish this same goal for JBoss 5/6, I'd appreciate it as well.
Adding the desired packages to the OSGi subsystem properties in domain.xml like this does not work. I added it to both profiles on a fresh JBoss 7 download.
The ControllerBootThread still can't see the classes and throws NoClassDefFoundErrors.
Here is a tutorial on using byteman with AS7
All system packes are initialized when the jboss module system bootstraps. This is much before OSGi subsystem configuration is even read.
Therefore we have this code In standalone.conf
if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman" fi
It adds the byteman packages to the jboss-modules system packages. It is likely that whatever you define in org.osgi.framework.bootdelegation must also be defined there.
Lets meet on #jbosgi @ irc.freenode.net in case you need more help.