Skip to content

Upgrade bytebuddy to 1.17.6 #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 28, 2025
Merged

Upgrade bytebuddy to 1.17.6 #761

merged 5 commits into from
Jun 28, 2025

Conversation

KeekLove
Copy link
Contributor

This is my problem recurrence:

skywalking:9.3.0

guava: 33.2.1

then:

An error occurred during startup

2025-06-26 19:43:35.174 WARN main AbstractClassEnhancePluginDefine : enhance class org.springframework.web.reactive.DispatcherHandler by plugin org.apache.skywalking.apm.plugin.spring.cloud.gateway.v20x.define.DispatcherHandlerInstrumentation is not activated. Witness class org.springframework.cloud.gateway.config.GatewayAutoConfiguration$1 does not exist. 
2025-06-26 19:43:35.177 WARN main AbstractClassEnhancePluginDefine : enhance class org.springframework.web.reactive.DispatcherHandler by plugin org.apache.skywalking.apm.plugin.spring.cloud.gateway.v21x.define.DispatcherHandlerInstrumentation is not activated. Witness class org.springframework.cloud.gateway.filter.LoadBalancerClientFilter does not exist. 
2025-06-26 19:43:35.179 WARN main AbstractClassEnhancePluginDefine : enhance class org.springframework.web.reactive.DispatcherHandler by plugin org.apache.skywalking.apm.plugin.spring.cloud.gateway.v4x.define.DispatcherHandlerInstrumentation is not activated. Witness class org.springframework.cloud.gateway.filter.factory.cache.LocalResponseCacheProperties does not exist. 
2025-06-26 19:43:36.310 ERROR main SkyWalkingAgent : Enhance class com.google.common.collect.Iterators error. 
java.lang.IllegalStateException: Unexpected type reference on method: 16
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$TypeExtractor$MethodExtractor.visitTypeAnnotation(TypePool.java:8791)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1453)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:745)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:425)
****
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)

Then I packaged it based on 9.5.0 (without upgrading byte-buddy) and found the same problem

INFO 2025-06-27 10:32:00.768 main Version : SkyWalking agent version: 9.5.0-SNAPSHOT-b1f18f3 
ERROR 2025-06-27 10:32:07.748 main SkyWalkingAgent : Enhance class com.google.common.collect.Iterators error. 
java.lang.IllegalStateException: Unexpected type reference on method: 16
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$TypeExtractor$MethodExtractor.visitTypeAnnotation(TypePool.java:8791)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1453)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:74****
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)

When I updated to 1.15.5, the problem was solved

INFO 2025-06-27 11:04:54.683 main SkyWalkingAgent : Skywalking agent transformer has installed. 
INFO 2025-06-27 11:04:55.195 main Version : SkyWalking agent version: 9.5.0-SNAPSHOT-b1f18f3 
INFO 2025-06-27 11:05:06.663 background-preinit AgentClassLoader : ****/infra/skywalking-agent/plugins/websphere-liberty-23.x-plugin-9.5.0-SNAPSHOT.jar loaded. 

@wu-sheng
Copy link
Member

As I mentioned, please update license file.

@wu-sheng wu-sheng added this to the 9.5.0 milestone Jun 27, 2025
@KeekLove
Copy link
Contributor Author

好的,吴老师,刚遗落了许可证的更新,我发起一个另外的pull request

@wu-sheng
Copy link
Member

Update here, you just need to update your branch.

@KeekLove
Copy link
Contributor Author

image
吴老师是这里么?

@wu-sheng
Copy link
Member

And keep English for global users. Thanks.

@wu-sheng
Copy link
Member

Yes.

@KeekLove
Copy link
Contributor Author

Should I withdraw this request and initiate it again?

@wu-sheng
Copy link
Member

Should I withdraw this request and initiate it again?

You should have a local branch, right? Just update it.

@KeekLove
Copy link
Contributor Author

Submitted, Mr. Wu

@wu-sheng
Copy link
Member

And changes.md in the root please.

@KeekLove
Copy link
Contributor Author

ok

@KeekLove
Copy link
Contributor Author

Submitted, Mr. Wu

@wu-sheng wu-sheng changed the title Fix:Upgrade bytebuddy(1.15.5) to solve:Unexpected type reference on m… Upgrade bytebuddy to 1.15.5 Jun 27, 2025
@wu-sheng
Copy link
Member

As a new dependency introduced, it seems to break UTs.
Could you rerun those and fix the expectation?

@wu-sheng
Copy link
Member

@kylixs Could you take a look as well?

@KeekLove
Copy link
Contributor Author

As a new dependency introduced, it seems to break UTs. Could you rerun those and fix the expectation?

ok

@KeekLove
Copy link
Contributor Author

After testing, I found that upgrading to 1.17.6 solved the problem. I tried to push and re-run UTS

@wu-sheng wu-sheng changed the title Upgrade bytebuddy to 1.15.5 Upgrade bytebuddy to 1.17.6 Jun 27, 2025
@wu-sheng wu-sheng added the core label Jun 27, 2025
@KeekLove
Copy link
Contributor Author

Maven-shade-plugin may need to be adjusted. I'll try again.

@wu-sheng
Copy link
Member

An new error shows up

Error: Error fetching link: /home/runner/work/skywalking-java/skywalking-java/apm-sniffer/apm-agent-core/target/site/apidocs/package-list. Ignored it.
Error: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.1:shade (default) on project apm-agent: Error creating shaded jar: Problem shading JAR /home/runner/.m2/repository/net/bytebuddy/byte-buddy/1.17.6/byte-buddy-1.17.6.jar entry META-INF/versions/24/net/bytebuddy/jar/asmjdkbridge/JdkClassWriter$1.class: java.lang.IllegalArgumentException -> [Help 1]

@KeekLove
Copy link
Contributor Author

Analysis shows that the new byte-buddy may contain java24 bytes, which causes the maven-shade-plugin to fail to package. I may need to consult byte-buddy to see if it can be excluded.

@KeekLove
Copy link
Contributor Author

image

@wu-sheng
Copy link
Member

Let's see how byte buddy community says

@KeekLove
Copy link
Contributor Author

okk

@KeekLove
Copy link
Contributor Author

raphw/byte-buddy#1833

@KeekLove
Copy link
Contributor Author

image

I'll try to exclude

@wu-sheng wu-sheng merged commit b7139d6 into apache:main Jun 28, 2025
207 of 283 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants