Questions tagged [byteman]

JBoss Byteman is a Java library to inject code into JVM programs. Injected code can access/alter program's runtime data and modify its behavior.

About

Byteman is a tool which makes it easy to trace, monitor and test the behaviour of Java application and JDK runtime code. It injects Java code into your application methods or into Java runtime methods without the need for you to recompile, repackage or even redeploy your application. Injection can be performed at JVM startup or after startup while the application is still running.

Links

25 questions
0
votes
1 answer

How to crash Jboss based on some condition

I am using JBoss 7x, and have the following use case. I am going to do load testing of messaging queues with Jboss. The queues are external to JBoss. I will push a lot of message in the queue, around 1000 message. When around 100+ message has been…
Naresh Chaurasia
  • 419
  • 5
  • 21
0
votes
1 answer

Instrumentation to count every statement in a Scala function

I have a simple Scala function in which I want to increment a class variable every time a statement is executed. class C { var cnt: Int: 0 def fun(): Unit = { var a: Int = 0 var b: Int = -10 …
0
votes
1 answer

Write stack trace of an exception into a file with Byteman

I have a framework that ignores exceptions in it, and I want to inspect the cause of these exceptions. I am trying to use Byteman to do it. Byteman can write the message of an exception, or call stack of the target method itself into a log file like…
SATO Yusuke
  • 1,600
  • 15
  • 39
0
votes
1 answer

Tracing a class in WAR file deployed in Wildfly 18

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…
Tom
  • 371
  • 2
  • 6
  • 15
0
votes
1 answer

Byteman Implementation Details

I was looking at the byteman implementation to understand how they work specifically for cases like tracking variables AT/AFTER nth read, AT/AFTER nth write etc. In their implementation they read a class two times once for checking if it matches…
0
votes
1 answer

Byteman 4.0.11 not entirely published to Maven Central?

The Byteman website advertises version 4.0.11 as released: https://byteman.jboss.org/downloads.html But only some artifact IDs are available on Maven Central: https://search.maven.org/search?q=g:org.jboss.byteman Did something go wrong during the…
yrodiere
  • 9,280
  • 1
  • 13
  • 35
0
votes
2 answers

Byteman - trace all classes and methods in a given package

When using Byteman, we have to specify the class and the method in the rule syntax. What if I want to trace program execution using Byteman? Example: I do not know which methods are being executed when executing a feature of the program. I want to…
Lizzy
  • 2,033
  • 3
  • 20
  • 33
0
votes
1 answer

Byteman JUnit Runner - impossible to trigger IOException on auto-closed InputStream#close

I have got the following code: Collection errors = ...; try (InputStream stream = My.class.getResourceAsStream(resource)) { // do stuff } catch(IOException ex) { errors.add("Fail"); } I'm trying with Byteman Junit Runner to trigger an…
fbiville
  • 8,407
  • 7
  • 51
  • 79
0
votes
1 answer

Modifying method arguments using byteman

I have classes as show below public class Caller { private Calle calle = new Calle(); public void invoke(final String arg) { calle.invoke(arg); } } public class Calle { public void invoke(final String arg) { } } public class…
psuman
  • 1
  • 1
0
votes
1 answer

How to change rules for byteman at runtime

I have running remoted test server where I want to make some modifications with existing code using byteman. Is it possible to attach byteman at runtime with custom rules files (While starting we should set rule file, that is not flexible for most…
Alexander Bezrodniy
  • 8,474
  • 7
  • 22
  • 24
1
2