byte-buddy: ByteBuddy is incompatible with CDS due to the Java 6 baseline
When running an application and Spring Boot 3.3 CDS support and Bytebuddy (typically Spring Data JPA applications like Petclinic), a lot of warnings are visible in the logs like [warning][cds] Skipping net/bytebuddy/description/type/TypeDefinition: Old class has been linked. I think this is due to the Java 6 baseline used by ByteBuddy, a Java 8 baseline would make ByteBuddy CDS compliant.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 21 (14 by maintainers)
@sdeleuze Could you give this another try and:
Build https://github.com/raphw/bytecode-update-maven-plugin Then build this branch: https://github.com/raphw/byte-buddy/tree/asm-multi-release
After that, CDS should work with byte-buddy.jar without any warnings.
I think I will implement this then. Normally jar size is not important as dependencies are cached. For agents, the mr feature can be unrolled as one can strip one of the versions out. Byte Buddy is already large as it covers the entire Java language and its instrumentation features, so the few people who have an issue with this will likely be able to address it.
I agree, generally speaking I would like to offer Byte Buddy as 1.8 class files. But I would want to allow adding a classifier or some other dependency configuration option, to allow tool vendor (typically for Java agents), to switch back to another artifact.
I will investigate how this could work and try to offer a solution. And please offer a solution if you already have an idea, I have to read up on this myself, too.
That would work, would however double the jar size. Possibly I could offer two artifacts. I will look into that.
Does class data sharing even support MR jars?