807 questions
1
vote
0
answers
47
views
Can't intercept Scala @specialized method override with ByteBuddy
I am experimenting with ByteBuddy and Scala specialization feature. I have this simple class:
class Main[@specialized(Int) X] {
private[this] var x :X = _
def value :X = x
def value_=(...
0
votes
0
answers
96
views
Maven project build error : package net.bytebuddy.agent.builder is not visible, package net.bytebuddy.description.type is not visible
I created new maven project in Eclipse IDE. While build it produced some errors. Below I listed the errors, pom.xml , MANIFEST.MF and Agent.java. What should I do to solve the errors?
Errors
[ERROR] /...
-1
votes
1
answer
140
views
Tests fail only in Jenkins but not locally after change of Mockito library
We have a repository with a mockito library "org.mockito:mockito-inline:4.11.0" defined in build.gradle. I changed it to "org.mockito:mockito-core:5.14.2".
I ran the unit tests ...
1
vote
1
answer
89
views
How to call varargs method in ByteBuddy in a way that bakes the arguments array as constants into the bytecode?
I'm generating classes with ByteBuddy. In one place, I need to call a static utility method which accepts varargs of type String. My code looks like this:
String[] myStringArray = generateParameters()
...
0
votes
1
answer
112
views
ByteBuddy throws java.lang.IllegalStateException - Cannot locate field named name for class
I am trying to explore and understand the bytebuddy library to create advice for one of the method. But I am encountering an exception upfront as below which seems a bit weird as given below:
...
0
votes
2
answers
3k
views
Does Mockito support Java 24?
My program is running on Java 24. When my test case adds Mockito, the following error is caught. Mockito is the latest already 5.17.0. Has Mockito supported Java 24 ?
mockito-core = 5.17.0
-Djdk....
1
vote
1
answer
684
views
What to do about byte-buddy-agent with spring-boot-tests?
I am getting the following when running tests (and only when running tests):
WARNING: A Java agent has been loaded dynamically (/home/guy/.m2/repository/net/bytebuddy/byte-buddy-agent/1.14.19/byte-...
0
votes
1
answer
82
views
ByteBuddy agent passing wrong data to ClassReader when using custom class loader
I'm using a Java agent with ByteBuddy to instrument class files. The application I'm instrumenting uses a custom class loader to decrypt classes. I noticed I was hitting this exception when ByteBuddy ...
1
vote
1
answer
42
views
BiDirectional Classes Association using ByteBuddy
I am mitigating a problem related on how to generate a bidirectional association in Java using DynamicTypes provided by ByteBuddy.
My main concern is how to define such DynamicTypes, investigating the ...
0
votes
0
answers
41
views
Cannot inject already loaded type: class
I have deployed the spring boot application with 6 k8 pods for first time not faced any issue. but once redeployed it giving below error. 500 concurrent requests. out of those 23 requests failed.
...
1
vote
1
answer
52
views
Unable to delegate interface method using Byte Buddy
I am working on an add-on to a unit testing tool that creates mocks, and for one feature I want to be able to intercept the call to the mock and cause a call to the super class (i.e. call the real ...
1
vote
1
answer
146
views
Completely redirecting calls to a static method with byte-buddy
I have a project that reads the contents of a jar file, modifies selected static methods in specific classes in that jar file so that they point to different static methods, then rewrites the jar file....
1
vote
1
answer
37
views
Why is dynamic assignment required in a particular case in Byte Buddy?
I have a TypeDescription.Generic built like this:
import static net.bytebuddy.description.type.TypeDescription.Generic.Builder.parameterizedType;
final TypeDescription.Generic supplierType =
...
1
vote
0
answers
66
views
Reset ByteBuddy modified classes between Spring Boot integration tests
Our Spring Boot application modifies classes by adding certain annotations (annotateType(...)) with ByteBuddy.
For example:
private DynamicType.Loaded<? extends MyClassToRedefine> ...
0
votes
2
answers
83
views
How properly ThreadLocal Context in the ByteBuddy Instrumentation Advice
Hi I'm trying to build a trace agent where app agent propagates the origin application name across the multiple network calls using the HTTPUrlConnection.
So far, I was able to invoke the Advice ...