I wanted to add some tracing on a method within our application deployed in Wildfly 18.
I could see only the first rule was loaded and printed from Console output (not server.log though) from Windows command prompt but the other Rule was never printed.
RULE show byteman is loaded
CLASS Main
METHOD main
AT ENTRY
IF TRUE
DO trace("Byteman at start");
traceln("Hey Byteman ");
ENDRULE
RULE Check Method1
CLASS com.xxx.xxx.MyClass
METHOD method1
AT ENTRY
IF true
DO trace("Method1 was called");
traceln("Method1 was called");
ENDRULE
RuleTriggerMethodAdapter.injectTriggerPoint : inserting trigger into org.jboss.as.server.Main.main(java.lang.String[]) void for rule show byteman is loaded
org.jboss.byteman.agent.Transformer : inserted trigger for show byteman is loaded in class org.jboss.as.server.Main
Rule.execute called for show byteman is loaded_0:1
HelperManager.install for helper class org.jboss.byteman.rule.helper.Helper
calling installed(show byteman is loaded) for helper classorg.jboss.byteman.rule.helper.Helper
Installed rule using default helper : show byteman is loaded
show byteman is loaded execute
Byteman at startHey Byteman
The problem here appears to be that your second rule has not been injected. The Byteman trace only shows the first rule being injected. Are you sure you have the correct details in your rule?
Does the class com.xxx.xxx.MyClass actually exist?
Does it have a method with name method1?
Does that class ever get loaded?
Does that method ever get called?
It certainly doesn't look like the answers to those last 2 questions can be yes because you would see inject and trigger messages if that were so.