1 Reply Latest reply on Apr 10, 2019 11:31 AM by Andrew Dinn

    Replacing types in a package x.y with analogs in package a.b?

    Scott Stark Master

      Say I have an application compiled against types in a package x.y that is no longer available. Suppose that all of these types have been moved to a package a.b. Can I use byteman to transform the application to run in a container that has the a.b package based types?

        • 1. Re: Replacing types in a package x.y with analogs in package a.b?
          Andrew Dinn Master

          Hi Scott,

          starksm64  wrote:

           

          Say I have an application compiled against types in a package x.y that is no longer available. Suppose that all of these types have been moved to a package a.b. Can I use byteman to transform the application to run in a container that has the a.b package based types?

          Afraid not. Byteman only injects code into methods. You really need something that transforms the relevant symbol table entries.

           

          Have you looked at the maven shade plugin? It can do what you want offline.

           

          If you really need to do the online then you can probably cook up a Java JVMTI agent to do what you want with only a moderate amount of relatively straightforward ASM programming needed to do the bytecode transformation.

           

          regards,

           

           

          Andrew Dinn