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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

how to know byteman agent port number?

what command needs to be run in order to know on what port is the installed javaagent of byteman is running? I tried running some byteman commands but couldn't find one that shows agent's port number. ...
0 votes
1 answer
19 views

How to set environment setting?

https://downloads.jboss.org/byteman/4.0.20/byteman-programmers-guide.html#environment-settings enter image description here how to set "org.jboss.byteman.compileToBytecode" property? this ...
0 votes
1 answer
49 views

How to throw exception using Byteman Script , in a method?

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 ...
0 votes
0 answers
57 views

Byteman script failed to refer to a class on Tomcat from a Java agent

Background Now I am trying to make the MBean SessionMonitor (the MBean to measure the size of HttpSession) into a Java agent for portability. The Eclipse project is: https://github.com/satob/...
  • 1,465
0 votes
1 answer
31 views

bmsubmit is not working due to Bad Request 400. Why?

I am using byteman 4.0.17. Installing byteman succeeded. Using bmsubmit.sh tool is throwing an error. $ byteman-download-4.0.17/bin/bmsubmit.sh -y Failed to process request: java.lang.Exception: ...
0 votes
1 answer
64 views

The remote byteman agent reported an error

I need a little help to understand what's wrong with by two rules. RULE inefficient FilterOutputStream write trace CLASS java.io.FilterOutputStream METHOD write( int ) AT RETURN IF TRUE DO traceStack(&...
2 votes
1 answer
103 views

how to inject rule script into java.sql.Statement.executeQuery(String)?

I edit a simple jetty web application using maven. I try to inject the following rule scripts into java.sql.Statement.executeQuery(String). RULE trace java.sql.Statement.executeQuery enter INTERFACE ^...
0 votes
1 answer
41 views

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 ...
3 votes
2 answers
164 views

Can byteman trigger a rule on a lambda?

The latest Byteman documentation (4.0.16) mentions inner classes, but doesn't mention lambdas. I have a rule looking like: RULE showdir CLASS ReportService METHOD lambda$retrieveReport$0 AT ENTRY IF ...
1 vote
1 answer
33 views

Byteman 4.0.14 verification commands after installation

I wrote script in powershell n linux script to install byteman, installation is successful after checking system variables as byteman home,will be added to varaibles and path. But how do I check it ...
0 votes
1 answer
78 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: ...
  • 73
0 votes
1 answer
221 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 ...
  • 1,465
0 votes
1 answer
120 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 ...
  • 181
1 vote
3 answers
149 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
1 answer
47 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
1 answer
33 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....
  • 8,896
1 vote
1 answer
1k 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
1 answer
166 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 ...
  • 20.1k
0 votes
2 answers
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 ...
  • 2,023
0 votes
1 answer
232 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")...
  • 7,994
0 votes
1 answer
879 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 ...
  • 1
0 votes
1 answer
634 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 ...