# Java APM Client Spring ClaassLoading Issue

**URL:** <https://discuss.elastic.co/t/java-apm-client-spring-claassloading-issue/252166>\
**Category:** APM\
**Tags:** java\
**Created:** [October 15, 2020, 10:05am UTC](https://discuss.elastic.co/t/java-apm-client-spring-claassloading-issue/252166 "2020-10-15T10:05:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [October 15, 2020, 10:05am UTC](https://discuss.elastic.co/t/java-apm-client-spring-claassloading-issue/252166/1 "2020-10-15T10:05:07Z")

</div>

I try to update the apm agent from 1.17.0 to 1.18.1.

But get the error below: (The same error occurs with 1.18.0 as well.)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/6/66a22b095ebb035eb949fdce5e245753ce8633ca.png)

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [October 15, 2020, 11:35am UTC](https://discuss.elastic.co/t/java-apm-client-spring-claassloading-issue/252166/2 "2020-10-15T11:35:47Z")

</div>

Hi @suikast42,

It seems that bytecode modification applied by the agent may cause this error.  
Is it reproducible systematically ?

Can you try to start the agent with `log_level=debug` and give us the name of the instrumentation classes that are applied to this method ? using `cat agent.log | grep 'StcRepository' | grep 'Method match'`

Also, can you provide the exact JVM version and vendor that you are using ? (output of `java -version` would provide this).

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [October 16, 2020, 7:55am UTC](https://discuss.elastic.co/t/java-apm-client-spring-claassloading-issue/252166/3 "2020-10-16T07:55:47Z")

</div>

Also, what could help here would be to get the modified bytecode for this class, you can instruct the agent to dump that to filesystem by:

- creating a temporary folder `/tmp/bytebuddy-dump`
- add `-Dco.elastic.apm.agent.shaded.bytebuddy.dump=/tmp/bytebuddy-dump` to your JVM options

Then, if that particular class is modified by our agent, there should be multiple versions of that class suffixed with timestamp in the `/tmp/bytebuddy-dump` folder, you can attach those so we can analyze what could be wrong here.

---

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [October 28, 2020, 9:51am UTC](https://discuss.elastic.co/t/java-apm-client-spring-claassloading-issue/252166/4 "2020-10-28T09:51:56Z")

</div>

Sorry for late response. I am at commissioning since few weeks.  
But try this as soon as possible

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 18, 2020, 5:52am UTC](https://discuss.elastic.co/t/java-apm-client-spring-claassloading-issue/252166/5 "2020-11-18T05:52:07Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
