Skip to content
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

Fix modularized applications having a dependency version conflict #2373

Open
jackshirazi opened this issue Dec 24, 2021 · 2 comments
Open

Fix modularized applications having a dependency version conflict #2373

jackshirazi opened this issue Dec 24, 2021 · 2 comments
Assignees

Comments

@jackshirazi
Copy link
Contributor

discussion in https://discuss.elastic.co/t/apm-java-agent-v1-27-0-instrumention-errors-on-modulepath/292877

Describe the bug

When a modularized application (ie uses module-info.java, the Java Platform Module System JPMS) has a dependency that the agent also has, it look like the module specified dependency is first resolved by all classloaders because that's how the module system is implemented. For the agent to have isolated dependencies, it seems we need to use module layers

Steps to reproduce

Per the example in the discussion thread - a basic hello world spring-boot modularized application

Expected behavior

In this case spring-boot has a dependency on byte-buddy version 1.11.22, while the agent has a dependency on version 1.12.3, but version 1.11.22 is loaded and used by the agent, resulting in stack trace errors and feature failure. Lines in the stack traces would include many entries like

   at net.bytebuddy@1.11.22/net.bytebuddy....
@eyalkoren eyalkoren added this to the 8.1 milestone Dec 26, 2021
@jackshirazi
Copy link
Contributor Author

note the reason we didn't see this before 1.28 was prior to 1.27 we shaded the agent dependencies so they were actually different package names

@jackshirazi
Copy link
Contributor Author

I succeeded in implementing an integration test with a dockerized container, here https://github.com/jackshirazi/apm-agent-java/tree/test-for-2373 under integration-tests/spring-boot-2-6-2. Not yet added the assertion that fails but everything else is there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants