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

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 TRUE DO…
David Plumpton
  • 1,929
  • 23
  • 31
1
vote
1 answer

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 ^java.sql.Statement METHOD executeQuery(String) AT…
dreammaker
  • 11
  • 1
1
vote
1 answer

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 whether it has installed it or not.
1
vote
3 answers

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 following ByteBuddy advice-based instrumentation, which…
Seva Safris
  • 401
  • 4
  • 12
1
vote
1 answer

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 void premain(final String agentArgs, final…
Seva Safris
  • 401
  • 4
  • 12
1
vote
1 answer

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 Byteman to accomplish this. I wrote this rule file for…
ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
0
votes
0 answers

Byteman on native methods

Can Byteman be used on native methods like Thread.sleep, System.currentTimeMillis() ? I tried RULE catch_Thread.sleep CLASS java.lang.Thread METHOD java.lang.Thread.sleep(long) void IF true DO traceln("[BMAN] Sleep: "+ $1) ENDRULE It's not working.
0
votes
1 answer

byteman rule: return 10.001, got invalid expression error

Byteman version: 4.0.21 RULE test rule CLASS Test METHOD getDouble AT EXIT IF true DO return 10.001 ENDRULE java logs: TransformListener() : handling connection on port 9091 retransforming Test org.jboss.byteman.agent.Transformer : error parsing…
qxp
  • 3
  • 1
0
votes
0 answers

How to resovle this deadlock problem when i instrument some codes {sleep(10)} in java.util.ArrayList.size()?

Environment: jdk8 , use byteman with maven test. I use byteman to instrument the following code into the java.util.ArrayList.size() menthod, but i meet a deadlock, it seems to a issue of byteman. the instrument code: (as you can see, just sleep…
0
votes
0 answers

java.lang.Exception: BMUnit method configuration pushed without prior method configuration pop

I use byteman with Junit from maven. I tested the hadoop project. I add some properties in the root pom.xml according to official site. com.byteman
0
votes
0 answers

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. I am not looking for the port which the agent is…
0
votes
1 answer

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 document doesn't give an example. I try to set environment…
0
votes
1 answer

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 entering main") DO throw new…
a3.14_Infinity
  • 5,653
  • 7
  • 42
  • 66
0
votes
1 answer

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: Invalid name/value pair in line [HTTP/1.1 400 Bad…
Jeremy Whiting
  • 305
  • 4
  • 8
0
votes
1 answer

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("*** Slow write calls ***", 10) ENDRULE RULE…
Jeremy Whiting
  • 305
  • 4
  • 8
1
2