Uploaded image for project: 'Java Mission Control'
  1. Java Mission Control
  2. JMC-8045

retransformClasses() doesn't retransform all needed classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9.0.0
    • None
    • Mission Control Core
    • None

      The retransformClasses() methods in Agent and AgentController use Class.forName() to try to get the class objects of  classes needed to retransform. This obviously doesn't work for classes loaded by classloaders different from the one which loads the agent.

      Those classes would be instrumented if they were loaded after their event probes were defined the AgentController. But when loaded earlier they would not be instrumented.

      The fix is to iterate over all loaded classes via Instrumentation.getAllLoadedClasses() and check if a class matches an event probe definition.

            rschmelter Ralf Schmelter
            rschmelter Ralf Schmelter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: