Comments (4)
I am currently on vacation, but I will look at it first time I am back. First suspicion: Byte Buddy is not currently configured to keep a reference to the generated class'es byte code after it is first loaded. Try the manifest version of the wrapper strategy. I guess, power mock requires explicit access to the byte code!
from byte-buddy.
I had a look at it. The error lies with Power Mock, in my opinion. During class loading, Byte Buddy's class loader is queried for the super class of the runtime generated class SampleClass
. This is standard class loader behaviour and cannot be changed.
This class is however not longer available. The error breaks down to:
@Test
public void testFoo() throws Exception {
sample.getClass().getClassLoader().loadClass(sample.getClass().getName());
}
what causes the same error, even without using Byte Buddy. From PowerMock's MockClassLoader
I can see that there are loading exceptions for specific libraries, like e.g. cglib or javassist to presumeable prevent the same problem. The would need to include Byte Buddy in this list, I assume.
from byte-buddy.
On my side, I succeed to remove my dependency to PowerMock. So no more problem :)
Do you want I open a issue on PowerMock, or you take the point?
from byte-buddy.
If you have the minutes, please report it to PowerMock. I am still officially on vacation, I can alternatively do it afterwards.
from byte-buddy.
Related Issues (20)
- how i use advice to match java.util.regex.Pattern HOT 9
- Hot to change the argument's field HOT 1
- UnsupportedOperationException when creating class with Adoptium JDK 21 HOT 3
- Instrumenting two methods with the same Advice class HOT 3
- IllegalStateException: Cannot define abstract method '...' for non-abstract class when defining a native method HOT 4
- What is the best way to create setters and getters by field name? HOT 3
- `Failing.FAIL_FAST` should expose original exception HOT 1
- `MemberAttributeExtension.ForField().on(…)` does not consider previously added annotations HOT 3
- Inconsistent frame length when instrumenting a method HOT 8
- 1.14.11 missing from Maven Central HOT 1
- VerifyError: Bad access to protected data in invokevirtual HOT 3
- Cannot resolve `In` from class `zio.cache.Cache$$anon$1` HOT 3
- How to apply Byte Buddy plugin placed under /src/test? HOT 13
- I am sorry, this is a question about java bytecode HOT 5
- Not able to intercept methods of java.net.HttpURLConnection class in Java 17 HOT 1
- Strange interaction with method implementations for methods from composite interfaces HOT 1
- Replace Method Code HOT 3
- Can I replace the new byte[] in the onTransformation method? HOT 1
- I want to use bytebuddy to advice java.time.LocalDateTime HOT 3
- BUG: instrumentation error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byte-buddy.