I have tried following script , but I do not see NullPointerException in the logs.
RULE trace main entry
CLASS StringCheck
METHOD main
AT ENTRY
IF true
DO traceln("Byteman detected you are entering main")
DO throw new NullPointerException("test")
ENDRULE
Firstly, your rule is malformed. Try this:
RULE trace main entry CLASS StringCheck METHOD main AT ENTRY IF true DO traceln("Byteman detected you are entering main"); throw new NullPointerException("test") ENDRULE
Secondly, when you are developing some new rules try enabling verbose output from the Byteman agents so that you are notified when rules fail to parse or inject. You can do that by adding the following setting to the java command line
-Dorg.jboss.byteman.verbose
Thirdly, before running your program with the Byteman agent you should really check your rules using the the bmcheck script provided in the bin subdirectory of your Byteman download.