1 Reply Latest reply on Jun 26, 2015 4:28 AM by adinn

    Byteman agent fails to load on the IBM J9 VM


      We use BMUnitRunner test annotation to dynamically load the agent into the IBM J9 VM which fails with


      *** java.lang.instrument ASSERTION FAILED ***: "jvmtierror == JVMTI_ERROR_NOT_AVAILABLE" at JPLISAgent.c line: 1009

      Exception in thread "Attachment 59984" Agent failed to start!

      JVMJ9TI064E Agent initialization function Agent_OnAttach failed for library instrument, return code 102


      We have raised issue [JBTM-2440] Byteman tests fail when running with the IBM JVM - JBoss Issue Tracker to track the problem.

      Is this something that bytman could support, in which case I will raise a byteman issue, or alternatively is there a workaround?

        • 1. Re: Byteman agent fails to load on the IBM J9 VM

          Hi Mike,

          Is this something that bytman could support?


          I think you will have to ask the IBM J9 team about that or -- if you are really desperate -- read the J9 manual.


          Byteman relies upon the underlying host JVM/JDK to support the Java agent Attach API. The error message suggests that -- at least with the default configuration -- J9 does not support this API. It may be that J9 does support it but disables it by default. I don't really know the answer to that.


          Ok, I looked online and the IBM docs appears to suggest that Java agents are supported from the command line. It also looks like they may require a property setting for dynamic loading using the Attach API. Did this work using the J9 JDK7 release? If so then this may represent a change from enabling agents by default to disabling them by default. If that is correct you could try running with this define on the command line



          The JDK8 docs offer this setting as a way of enabling agent loads to proceed.