# Lab 5.2: Connection refused running for java application - PetClinicApplication

**URL:** <https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189>\
**Category:** Elastic Training\
**Created:** [February 4, 2021, 2:28am UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189 "2021-02-04T02:28:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [February 4, 2021, 2:28am UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/1 "2021-02-04T02:28:49Z")

</div>

This is an error in the Lab version: [dwwkb5xfwhxvemvdh-ihsdbxb2mswxpjpnh.labs.strigo.io](http://dwwkb5xfwhxvemvdh-ihsdbxb2mswxpjpnh.labs.strigo.io)

**Steps to reproduce** :

1. login to lab
2. ssh petclinic-server
3. pkill java
4. run the java application (refer Lab 5.2: Services Layer of the Lab Guide: Elastic Observability Engineer

The following error is encountered and Kibana shows no data in APM for  
INFO PetClinicApplication - Started PetClinicApplication in 27.884 seconds (JVM running for 58.674)

2021-02-04 02:00:44.057 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type METRICS with this error: Connection refused (Connection refused)

2021-02-04 02:00:44.057 [elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 1 seconds (+/-10%)

2021-02-04 02:01:14.059 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type METRICS with this error: Connection refused (Connection refused)

Any clues?

---

<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:** [February 4, 2021, 9:08am UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/2 "2021-02-04T09:08:48Z")

</div>

Hi @Stud21 ,

I don't know (nor can access) this lab environment, but you should be able to find help in the [troubleshooting](https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html) section of our documentation.

This kind of error often appears when Kibana / APM server / Elasticsearch is not running, thus maybe if Elasticsearch was running on the same host your `pkill` command also terminated Elasticsearch process.

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [February 4, 2021, 9:20pm UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/3 "2021-02-04T21:20:34Z")

</div>

HI Sylvan,  
I had Elasticsearch and Kibana working at the time; no issues. However, as stated in the tutorial I followed the steps to view the data in Kibana-APM, I could only view the petclinic-node. I was not able to view the petclicnic-java and even the petclinic-address-finder links as stated in training (shown below).

Seems like the connection was broken or not allowed. Anyone in Infra you can check there with?

Thanks.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/7/47870b355e1dcb4e476506aba389cbb5df686630.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:** [February 5, 2021, 3:31pm UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/4 "2021-02-05T15:31:04Z")

</div>

FYI I've transferred this topic to a different section so that you can get help on the Training material/environment.

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [February 5, 2021, 6:27pm UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/5 "2021-02-05T18:27:52Z")

</div>

Hi @Stud21

it looks like the `address-finder` container is not running. Please try restarting it with the following command line: `docker restart address-finder`.

Best,  
Andre

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [February 5, 2021, 6:41pm UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/7 "2021-02-05T18:41:52Z")

</div>

Hi @Stud21

if you are still having issues after restarting the Java application that is probably because the APM Server is not running or has a misconfiguration.

Please check steps 4, 5, and 6 from lab 5.1 to make sure APM Server is running and has the same configuration from exercises.

Best,  
Andre

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [February 9, 2021, 5:41am UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/8 "2021-02-09T05:41:45Z")

</div>

Hi Andre,  
Running docker restart address-finder worked.  
Thanks

---

<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 4, 2022, 8:23am UTC](https://discuss.elastic.co/t/lab-5-2-connection-refused-running-for-java-application-petclinicapplication/263189/9 "2022-11-04T08:23:18Z")

</div>


