5 Replies Latest reply on Oct 10, 2013 1:38 PM by pasturel

    [announce] a byteman rule packager

    pasturel

      Hello,

      i have just finished a byteman rules packager. A library of about fifteen template rules and helpers. You can download it at GitHub repo =>
      https://github.com/PASTJL/bytemanPkg

      here is the readme for more informations

      https://github.com/PASTJL/bytemanPkg/blob/master/README.md

       

      I am interested for all of yours comments, or ideas of new features ...

        • 1. Re: [announce] a byteman rule packager
          adinn

          Hi Jean-Louis,

           

          Thanks for presenting this. I have not had time to look at it properly but it looks very interesting. I did download and build your git tree and install the resulting zip (the zip file in the git repo was corrupt). I followed the instructions to modify and run scripts/bytemapPkg.sh but it failed with the following exception

           

          [adinn@zenade bytemanPkg]$ $PWD/scripts/bytemanpkg.sh
          root=<...>/bytemanPkg/scripts/..
          Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
              at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
          Caused by: java.lang.ClassNotFoundException: javafx.application.Application
              at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

           

          So, it looks like I don't have some of the javafx classes installed. Any idea what I need to do to obtain them?

          • 2. Re: [announce] a byteman rule packager
            pasturel

            Hello Andrew,

            First you need a JRE/JDK 1.7.0

            the jfx classes are in JRE_HOME/lib/jfxrt.jar, it must be added to the classpath in the script :bytemanpkg.sh

            in fact the JAVA_HOME must point to JRE_HOME. I will correct it.


            ######## These two environnement Variables must be adapted #########
            ###
            JAVA_HOME=/opt/jdk1.7.0_40/jre
            ## workspace directory must be created before launching thi script
            workspace=/opt/eclipse/workspace/workspaceBM
            #######################################################

             

            if [[ ! -d $workspace ]]; then
                echo "the workspace : $workspace doesn't exist. Please create the directory or adapt the variable"
                exit 1
            fi

             

            #root=/opt/bytemanPkg
            root=`dirname $0`/..
            echo root=$root
            CLASSPATH=$root/bytemanPkg.jar
            CLASSPATH=$CLASSPATH:$root/config
            CLASSPATH=$CLASSPATH:$root/lib/jsch-0.1.49.jar
            CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/jfxrt.jar
            CLASSPATH=$CLASSPATH:$root/lib/antlr-runtime-4.1.jar
            CLASSPATH=$CLASSPATH:$root/lib/bytemancheck.jar
            CLASSPATH=$CLASSPATH:$root/lib/jfxmessagebox-1.1.0.jar
            $JAVA_HOME/bin/java  -Dprism.order=es2,j2d -cp $CLASSPATH -Droot=$root -Dworkspace=$workspace -Xms128M -Xmx128M jlp.byteman.packager.Packager

             

            I will soon deliver a new version, that integrated your "dynamic" instrumentation ( bminstall, bmsubmit) as remote actions. They run perfectly. I need to write a little doc about them.

            I will also add in a second time, a tool for charting csv files produted by the custom rules. This tool is based on JFeeChart. ( i have to extract it from another personal application).

            Byteman is a great tool !, really

             

            Thank Andrew.

            • 3. Re: Re: [announce] a byteman rule packager
              adinn

              Hi Jean-Louis,

              Jean-Louis Pasturel wrote:

               

              First you need a JRE/JDK 1.7.0

              the jfx classes are in JRE_HOME/lib/jfxrt.jar, it must be added to the classpath in the script :bytemanpkg.sh

              in fact the JAVA_HOME must point to JRE_HOME. I will correct it.

              Ok, I just commented out the line above because my JAVA_HOME was already set to point to a JDK1.7 SDK root i.e. not to the underlying jre tree (I suspect that most developers will have a similar setup).

               

              However, I realise that there is also a further problem. I don't have JavaFX jar in my jre/lib direcory. That's because I am using OpenJDK and JavaFX is an Oracle proprietary extension to Java.

               

              I don't know much about how JavaFX has been built. Does the code in the JavaFX jar also require native library code in the jre tree? Does it require any Oracle-properietary JVM extensions (i.e. have they made it impossible to use it on OpenJDK?).

              • 4. Re: [announce] a byteman rule packager
                pasturel

                Hi Andrew,

                Yes i use Oracle JDK.

                There is also an OpenJFX with OpenJDK, but i have not tested.

                https://wiki.openjdk.java.net/display/OpenJFX/Main

                The faster solution is to try with an Oracle JDK.

                • 5. Re: [announce] a byteman rule packager
                  pasturel

                  New version V1.1
                  https://github.com/PASTJL/bytemanPkg

                  here is the readme for more informations

                  https://github.com/PASTJL/bytemanPkg/blob/master/README.md

                  to get a correct bytemanPkg.zip ( all needed for installation)  you must download the entire the package ( button "Download ZIP" at the bottom-right of the page)