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.
12
questions
0
votes
1answer
60 views
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: ...
0
votes
1answer
20 views
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 ...
0
votes
1answer
32 views
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 ...
1
vote
3answers
65 views
Is it possible to intercept array constructor with ByteBuddy?
I have a regression test where I'm trying to count the number of instantiations of arrays. Specifically, I'm interested in counting how many times new int[..] is called. I have put together the ...
0
votes
1answer
25 views
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 ...
0
votes
1answer
28 views
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....
1
vote
1answer
466 views
ByteBuddy 1.10.2 throws `java.lang.IllegalStateException: Cannot resolve type description for java.lang.Exception`, and similar
I am seeing Cannot resolve type description errors from AgentBuilder.Listener.onError(...) when installing an AgentBuilder transformation for an Instrumentation.
The agent code is:
public static ...
1
vote
1answer
147 views
Byteman preventing Wildfly 8.1.0 from starting?
When my wildfly 8.1.0 server starts up, it should create an instance of a class.
I'm not sure whether that's happening or not, and I'm unable to change the source code, so I figured I would use ...
0
votes
2answers
1k views
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 ...
0
votes
1answer
203 views
Byteman JUnit Runner - impossible to trigger IOException on auto-closed InputStream#close
I have got the following code:
Collection<String> errors = ...;
try (InputStream stream = My.class.getResourceAsStream(resource)) {
// do stuff
}
catch(IOException ex) {
errors.add("Fail")...
0
votes
1answer
726 views
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 ...
0
votes
1answer
577 views
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 ...