# Java Agent APM won't send data to Elasticsearch

**URL:** <https://discuss.elastic.co/t/java-agent-apm-wont-send-data-to-elasticsearch/323489>\
**Category:** APM\
**Tags:** java, server\
**Created:** [January 19, 2023, 8:42am UTC](https://discuss.elastic.co/t/java-agent-apm-wont-send-data-to-elasticsearch/323489 "2023-01-19T08:42:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerratriani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zerratriani/32/113308_2.png) [@zerratriani](https://discuss.elastic.co/u/zerratriani)\
**Post date:** [January 19, 2023, 8:42am UTC](https://discuss.elastic.co/t/java-agent-apm-wont-send-data-to-elasticsearch/323489/1 "2023-01-19T08:42:45Z")

</div>

I have a java application and want to monitor it. the two hosts between the APM server and the application server are well connected. I have also deactivated the firewall but the data from the apm agent was not successfully sent to elasticsearch and did not appear in kibana

**Kibana version** : 8.1.0

**Elasticsearch version** : 8.1.0

**APM Server version** : 8.1.0

**APM Agent language and version** : JAVA version 1.35.0

**Log from APM-Server** :

```auto
{"log.level":"error","@timestamp":"2023-01-19T03:21:45.919-0500","log.logger":"beater","log.origin":{"file.name":"beater/waitready.go","file.line":64},"message":"precondition failed: EOF","service.name":"apm-server","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2023-01-19T03:22:00.930-0500","log.logger":"beater","log.origin":{"file.name":"beater/waitready.go","file.line":64},"message":"precondition failed: EOF","service.name":"apm-server","ecs.version":"1.6.0"}

```

**Log from Catalina.out** :

```auto
2023-01-19 15:38:03,543 [elastic-apm-server-reporter] WARN co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - null
2023-01-19 15:38:03,543 [elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)
2023-01-19 15:38:38,979 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error sending data to APM server: Read timed out, response code is -1

```

**Configuration in Catalina.sh**

```auto
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/Elastic/elastic-apm.jar -Delastic.apm.service_name=supercar -Delastic.apm.server_urls=http://172.16.11.226:8200 -Delastic.apm.environment=production -Delastic.apm.application_packages=org.apache.org"

```

**And here if i curl from application server to APM Server**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/4/846cdfc59089c1fcc9a430aade34ddc34ba9523c.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:** [January 19, 2023, 10:07am UTC](https://discuss.elastic.co/t/java-agent-apm-wont-send-data-to-elasticsearch/323489/2 "2023-01-19T10:07:46Z")

</div>

Hi @zerratriani ,

Could you capture the logs using [this procedure](https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html#trouble-shooting-logging-procedure) please ?

For now only the agent logs are required for investigation.

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [January 19, 2023, 2:02pm UTC](https://discuss.elastic.co/t/java-agent-apm-wont-send-data-to-elasticsearch/323489/3 "2023-01-19T14:02:12Z")

</div>

This part of the APM Server logs indicates that something is not right with the setup for the apm-server, as it cannot verify that the index templates are properly setup.

> [@zerratriani](#):
>
> `precondition failed: EOF`

Please provide more details how you set up the APM Server (standalone or managed by Elastic Agent & Fleet) and if you have changed Elasticsearch output configurations in the 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:** [February 9, 2023, 10:02am UTC](https://discuss.elastic.co/t/java-agent-apm-wont-send-data-to-elasticsearch/323489/4 "2023-02-09T10:02:48Z")

</div>

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