3 Replies Latest reply on Apr 16, 2014 8:01 AM by Tomaz Cerar

    Does Byteman 2.1.4.1 work with Jboss AS 7.1.1?

    Marco Rietveld Novice

      Hi all,

       

      Long time listener, first time caller!

      The arquillian/byteman combo has saved my rear-end numerous times in the last couple months. Thank you both.

       

      I have the following setup:

      - jboss as 7.1.1

      - mvn unzips the jboss-as-dist in the target directory

      - project uses jboss-as-arquillian-container-managed to do arquillian test

      - mvn copies byteman jar (2.1.4.1) to target/ directory

      - arquillian.xml has the following lines:

            -Xms512m -Xmx1024m -XX:MaxPermSize=512m
            -javaagent:target/byteman.jar=script:src/test/resources/byteman/SecurityLogging.btm,boot:target/byteman.jar,boot:target/${jboss.server.name}/jboss-modules.jar
            -Dorg.jboss.byteman.transform.all 
            -Djboss.modules.system.pkgs=org.jboss.byteman

       

      When I use 7.1.1.Final, I get this message:

      Mar 9, 2014 8:49:18 PM org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternalINFO: Starting container with: [/usr/java/jdk1.7.0_25/bin/java, -Xms512m, -Xmx1024m, -XX:MaxPermSize=512m, -javaagent:target/byteman.jar=script:src/test/resources/byteman/SecurityLogging.btm,boot:target/byteman.jar,boot:target/jboss-as-7.1.1.Final/jboss-modules.jar, -Dorg.jboss.byteman.transform.all, -Djboss.modules.system.pkgs=org.jboss.byteman, -ea, -Djboss.home.dir=target/jboss-as-7.1.1.Final, -Dorg.jboss.boot.log.file=target/jboss-as-7.1.1.Final/standalone/log/boot.log, -Dlogging.configuration=file:target/jboss-as-7.1.1.Final/standalone/configuration/logging.properties, -Djboss.modules.dir=/home/mrietvel/Workspace/jbpm_5/scratch/scratch-arquillian/scratch-arquillian-as7/target/jboss-as-7.1.1.Final/modules, -Djboss.bundles.dir=/home/mrietvel/Workspace/jbpm_5/scratch/scratch-arquillian/scratch-arquillian-as7/target/jboss-as-7.1.1.Final/bundles, -jar, /home/mrietvel/Workspace/jbpm_5/scratch/scratch-arquillian/scratch-arquillian-as7/target/jboss-as-7.1.1.Final/jboss-modules.jar, -mp, target/jboss-as-7.1.1.Final/modules, -jaxpmodule, javax.xml.jaxp-provider, org.jboss.as.standalone, -server-config, standalone-full.xml]
      2014-03-09 20:49:18,321 [main] INFO  XNIO Version 3.0.0.GA
      2014-03-09 20:49:18,336 [main] INFO  XNIO NIO Implementation Version 3.0.0.GA
      2014-03-09 20:49:18,348 [main] INFO  JBoss Remoting version 3.2.3.GA
      Exception in thread "main" java.lang.ExceptionInInitializerError
      Caused by: java.lang.NullPointerException
          at org.jboss.modules.Main.<clinit>(Main.java:353)

       

      When I switch to 7.2.0.Final, everything works fine..

       

      So, 2 questions:

      1. Known bug?

      2. Worth filing a jira for?

       

      I'm guessing "no" on both accounts.

        • 1. Re: Does Byteman 2.1.4.1 work with Jboss AS 7.1.1?
          Marco Rietveld Novice

          I can provide a test project fairly easily..

          • 2. Re: Does Byteman 2.1.4.1 work with Jboss AS 7.1.1?
            Andrew Dinn Master

            Marco Rietveld wrote:

             

            Hi all,

            . . .

            When I use 7.1.1.Final, I get this message:

            Mar 9, 2014 8:49:18 PM org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternalINFO: Starting container with: [/usr/java/jdk1.7.0_25/bin/java, -Xms512m, -Xmx1024m, -XX:MaxPermSize=512m, -javaagent:target/byteman.jar=script:src/test/resources/byteman/SecurityLogging.btm,boot:target/byteman.jar,boot:target/jboss-as-7.1.1.Final/jboss-modules.jar, -Dorg.jboss.byteman.transform.all, -Djboss.modules.system.pkgs=org.jboss.byteman, -ea, -Djboss.home.dir=target/jboss-as-7.1.1.Final, -Dorg.jboss.boot.log.file=target/jboss-as-7.1.1.Final/standalone/log/boot.log, -Dlogging.configuration=file:target/jboss-as-7.1.1.Final/standalone/configuration/logging.properties, -Djboss.modules.dir=/home/mrietvel/Workspace/jbpm_5/scratch/scratch-arquillian/scratch-arquillian-as7/target/jboss-as-7.1.1.Final/modules, -Djboss.bundles.dir=/home/mrietvel/Workspace/jbpm_5/scratch/scratch-arquillian/scratch-arquillian-as7/target/jboss-as-7.1.1.Final/bundles, -jar, /home/mrietvel/Workspace/jbpm_5/scratch/scratch-arquillian/scratch-arquillian-as7/target/jboss-as-7.1.1.Final/jboss-modules.jar, -mp, target/jboss-as-7.1.1.Final/modules, -jaxpmodule, javax.xml.jaxp-provider, org.jboss.as.standalone, -server-config, standalone-full.xml]
            2014-03-09 20:49:18,321 [main] INFO  XNIO Version 3.0.0.GA
            2014-03-09 20:49:18,336 [main] INFO  XNIO NIO Implementation Version 3.0.0.GA
            2014-03-09 20:49:18,348 [main] INFO  JBoss Remoting version 3.2.3.GA
            Exception in thread "main" java.lang.ExceptionInInitializerError
            Caused by: java.lang.NullPointerException
                at org.jboss.modules.Main.<clinit>(Main.java:353)

             

            When I switch to 7.2.0.Final, everything works fine..

             

            So, 2 questions:

            1. Known bug?

            2. Worth filing a jira for?

             

            I'm guessing "no" on both accounts.

             

            Know bug: probably no -- or rather not to me.

             

            Worth filing a JIRA: probably yes -- or rather not to me :-)

             

            It would be better directing this question at the Arquilian team. I don't (and cannot) really know what could be going wrong here without knowing what Arquilian is doing. The agent parameters on the command line look ok as far as any Byteman setup is concerned. After that I cannot tell why you might be seeing an NPE without more details about the app.

             

            The agent option "boot:target/jboss-as-7.1.1.Final/jboss-modules.jar" is certainly interesting -- the jar it is placing into the bootstrap path contains the Main class which is seeing the NPE. That may cause loader issues when the same jar is used as the target for the -jar command line option. I would expect the Main class to be directly loaded from the jar file by the system loader rather than accessed via the bootstrap loader. If it's <clinit> method links against to classes in the bootstrap which then link back to the bootstrap loader's version of the Main class then this could easily leave something in the system path version of Main uninitialized which might cause an NPE. Whether or not this sort of cross-loader linking can happen will depend on the semantics of the app rather than Byteman. So, this might be a problem or it might not. And, yes, since we are in the realm of class init it is quite possible that this could work in 7.1.1 but not in 7.2.0.

             

            Similarly, what is happening may depend upon the specifics of the script passed in the  agent option "script:src/test/resources/byteman/SecurityLogging.btm". It could be injecting code into the modules Main class for all I know.

            • 3. Re: Does Byteman 2.1.4.1 work with Jboss AS 7.1.1?
              Tomaz Cerar Master

              for what is worth, WildFly 8 uses byteman 2.1.4 already...

              maybe upgrading AS to 8 would help