2 Replies Latest reply: Mar 22, 2012 2:37 PM by Victor M. Ojeda V. RSS

    Using Byteman to test a class within a jar within an ear

    Victor M. Ojeda V. Newbie

      Hi all,

       

        I have an .ear file with a .jar file inside.

        I want to test some functions that belongs to a class contained in the jar file.

        The question is: how configure this?

      In run.sh of JBoss 5.1 I put the following:

       

      set JAVA_OPTS="${JAVA_OPTS} -Dorg.jboss.byteman.transform.all -javaagent:${BYTEMAN_HOME}/lib/byteman.jar=script:${BYTEMAN_HOME}/bin/thread.btm,boot:${BYTEMAN_HOME}/lib/byteman.jar,listener:true"

       

      Of course, BYTEMAN_HOME is set to the correct value.

       

      My very simple thread.btm file looks like:

       

      RULE test inside an ear

       

      CLASS com.acme.Test

       

      METHOD test

       

      IF true

       

      DO traceln("*** TESTING BYTEMAN ")

       

      ENDRULE

       

      --------------------------------------

      The ear structure is

       

      META-INF

        application.xml

        MANIFEST.MF

       

      myJar.jar

       

      ---------------------------------------

       

      The myJar.jar estructure is

       

      META-INF

        MANIFEST.MF

        com

          acme

            Test.class

       

       

      The Test class have a method called public void test()

       

      How to make this work?

       

      Thanks in advance

       

      Best regards,

       

        Víctor