2 Replies Latest reply: Oct 27, 2011 6:21 AM by swimablefish RSS

use byteman.sh -l failed

swimablefish Newbie

Hi, when i use "byteman.sh AppMain3 -l test2.btm", the test2.btm didn't been installed.  bmsubmit.sh showed no rule installed, and then use "bmsubmit.sh -l test2.btm", the rule would be installed successfully.

 

AppMain3.java

 

      import java.io.DataInputStream;

 

class AppMain3

{

    public static void main(String[] args)

    {

        Test1 t = new Test1();

 

 

        try {

            DataInputStream in = new DataInputStream(System.in);

            String next = in.readLine();

            while (next != null && next.length() > 0 && !next.contains("end")) {

                t.update();

                final String arg = next;

                Thread thread = new Thread(arg) {

                    public void run() {

                        System.out.println(arg);

                    }

                };

                thread.start();

 

 

                try {

                    thread.join();

                } catch (Exception e){

                }

                next = in.readLine();

            }

        } catch (Exception e) {

        }

    }

}

 

test2.btm

RULE update

CLASS Test1

METHOD update()

IF true

DO traceln("at write 5");

   Thread.sleep(5 * 1000)

ENDRULE

  • 1. Re: use byteman.sh -l failed
    Andrew Dinn Master

    Hi Swimable,

     

    swimablefish wrote:

     

    Hi, when i use "byteman.sh AppMain3 -l test2.btm", the test2.btm didn't been installed.  bmsubmit.sh showed no rule installed, and then use "bmsubmit.sh -l test2.btm", the rule would be installed successfully. 

    Hmm, I assume you mean bmjava.sh rather than byteman.sh?

     

    If that is the case then the problem here is that you have passed the -l argument to the Java main method of AppMain3 rather than to bmjava. You need this

     

    bmjava.sh -l test2.btm AppMain3

  • 2. Re: use byteman.sh -l failed
    swimablefish Newbie

    Yes, the argument should be in front of  AppMain3,