# APM agent for java is not working

**URL:** https://discuss.elastic.co/t/apm-agent-for-java-is-not-working/238679
**Category:** APM
**Tags:** java
**Created:** [June 25, 2020, 1:24pm UTC](https://discuss.elastic.co/t/apm-agent-for-java-is-not-working/238679 "2020-06-25T13:24:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gijo](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@gijo](https://discuss.elastic.co/u/gijo)
#### Post date: [June 25, 2020, 1:24pm UTC](https://discuss.elastic.co/t/apm-agent-for-java-is-not-working/238679/1 "2020-06-25T13:24:35Z")

</div>

HI,

I attached the elastic apm agent to my spring boot application as per [https://www.elastic.co/guide/en/apm/agent/java/current/setup-javaagent.html](https://www.elastic.co/guide/en/apm/agent/java/current/setup-javaagent.html) . I created a deployment for APM server in elastic cloud console as well.But the java agent is not sending any data to APM server.

This is the command line argument for jar  
java -javaagent:/data/tools/elastic-apm-agent-1.17.0.jar -Delastic.apm.service\_name=xxxx -Delastic.apm.server\_url=https://ed1eb8xxxxxxxxxxxxeu-west-1.aws.cloud.es.io:443 -Delastic.apm.secret\_token=xxxxxxxxxxxxxxxxxxxx -Delastic.apm.application\_packages=xxxx.xxx.xxx -jar -Xmx6g -Dspring.profiles.active=ecomqa -Dspring.profiles.include=qa -Dfile.encoding=UTF8 -Ddebug /data/xxxx.jar

Here is the link for the debug logs [https://gist.github.com/gijomathew7/01be00ae4907c359255557f64031afff](https://gist.github.com/gijomathew7/01be00ae4907c359255557f64031afff)

---

<div class="post-metadata">

### Author: ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)
#### Post date: [June 26, 2020, 8:32am UTC](https://discuss.elastic.co/t/apm-agent-for-java-is-not-working/238679/2 "2020-06-26T08:32:50Z")

</div>

Could you set `-Delastic.apm.log_level=debug` and send the logs again? There's not much I can see from the logs other than that the agent successfully established a connection to APM Server:

```auto
2020-06-25 13:30:20,039 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean
2020-06-25 13:30:21,884 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.17.0 as SIFU on Java 1.8.0_242 (Oracle Corporation) Linux 3.10.0-514.16.1.el7.x86_64
2020-06-25 13:30:21,885 [main] WARN co.elastic.apm.agent.configuration.StartupInfo - Detected usage of an old configuration key: 'server_url'. Please use 'server_urls' instead.
2020-06-25 13:30:21,922 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state
2020-06-25 13:30:22,808 [elastic-apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: {"ok":{"build_date":"2019-06-18T12:11:59Z","build_sha":"2e58a05c97d4551aca59ef09aff651c79ea3f4db","version":"6.8.1"}}

```

Which web framework are you using in your spring boot application? Is it Spring MVC on a Tomcat server?

Could you test if version 1.15.0 is working for you as expected? Is there a chance you could test with a more recent version of APM Server?

---

<div class="post-metadata">

### Author: ![gijo](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@gijo](https://discuss.elastic.co/u/gijo)
#### Post date: [June 26, 2020, 9:07am UTC](https://discuss.elastic.co/t/apm-agent-for-java-is-not-working/238679/3 "2020-06-26T09:07:20Z")

</div>

Hi,

I have changed the agent version to 1.15.0 and the logs are availabe at [https://gist.github.com/gijomathew7/3b268ace2d26d10e351e0b37b3cab1a1](https://gist.github.com/gijomathew7/3b268ace2d26d10e351e0b37b3cab1a1).  
The APM server version is 6.8.1  
The application is spring MVC on Tomcat server.

---

<div class="post-metadata">

### Author: ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)
#### Post date: [June 26, 2020, 10:48am UTC](https://discuss.elastic.co/t/apm-agent-for-java-is-not-working/238679/4 "2020-06-26T10:48:01Z")

</div>

Logs look good. There are 23 reported events:

```auto
2020-06-26 09:11:46.717 [elastic-apm-init-instrumentation-shutdown-hook] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Reported events: 23

```

So it seems like the events could successfully be sent to your APM Server.

---

<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: [July 17, 2020, 6:48am UTC](https://discuss.elastic.co/t/apm-agent-for-java-is-not-working/238679/5 "2020-07-17T06:48:44Z")

</div>

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