elastic / elastic/apm-agent-java

Fix modularized applications having a dependency version conflict

Aperta
#2,373 2 commenti 0 reazioni 1 assegnatario Rivendicata da @jackshirazi Vedi su GitHub
agent-java bug
Lingua principale
Java
Stelle
594
Fork
338
Merge medio
1g 13h
PR unite (30g)
25

Descrizione

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....
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.