question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update ByteBuddy from 1.8.22 to 1.9.15

See original GitHub issue

Hi @raphw

I’m trying to update the ByteBuddy Version to 1.9.15 in Stagemonitor.

As mentioned in #470 the method asDecorator is removed but if i understand it right, there is no need to call asDecorator anymore. Problem, without calling asDecorator the instrumention doesn’t work anymore 😦.

AgentAttacher.java#L211-L228

private static ClassFileTransformer initByteBuddyClassFileTransformer(AutoEvictingCachingBinaryLocator binaryLocator) {
		AgentBuilder agentBuilder = createAgentBuilder(binaryLocator);
		for (StagemonitorByteBuddyTransformer transformer : getStagemonitorByteBuddyTransformers()) {
			agentBuilder = agentBuilder
					.type(transformer.getMatcher())
					.transform(transformer.getTransformer())
					.asDecorator();
		}


		final long start = System.currentTimeMillis();
		try {
			return agentBuilder.installOn(instrumentation);
		} finally {
			if (corePlugin.isDebugInstrumentation()) {
				logger.info("Installed agent in {} ms", System.currentTimeMillis() - start);
			}
		}
	}

As i’m a absoulte newbie on BuddyBuddy and not find the right information in the documentation and now i hope you can give me an advice?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
raphwcommented, Jul 27, 2019

Alright, I found the problem. I (unintentionally) reversed the transformer application order in Byte Buddy 1.9.0. I do not want to undo this now, 1.9.0 has been around for a while. I will now also add a test for retaining this application order.

If you reverse the order in the comparator in AgentAttacher (line 287) while updating to 1.9.*, everything should work as expected.

1reaction
raphwcommented, Jul 26, 2019

It’s probably a small thing, I can have a look tomorrow!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Byte Buddy - runtime code generation for the Java virtual ...
I'm your Byte Buddy! Byte Buddy is a code generation and manipulation library for creating and modifying Java classes during the runtime of...
Read more >
byte-buddy-gradle-plugin 1.9.15 javadoc (net.bytebuddy) - javadoc.io
A class loader resolver for creating class loaders for given class paths. Initialization. Defines an entry point for a Byte Buddy transformation in...
Read more >
byte-buddy: 同步https://github.com/raphw/byte-buddy - Gitee
Byte Buddy is a code generation and manipulation library for creating and modifying Java classes during the runtime of a Java application and...
Read more >
artifact listener › net.bytebuddy:byte-buddy
Version, Last update, Links ... 1.9.15, 21/07/2019. 1.9.14, 08/07/2019. 1.9.13, 25/05/2019. 1.9.12, 26/03/2019 ... 1.8.22, 08/09/2018. 1.8.21, 02/09/2018.
Read more >
Adicionar extensões (XWiki.AddExtensions) - CNJ
Byte Buddy is a Java library for creating Java classes at run time. This artifact is a build of Byte Buddy with all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found