# APM Problem with Java standalone

**URL:** <https://discuss.elastic.co/t/apm-problem-with-java-standalone/175214>\
**Category:** APM\
**Created:** [April 3, 2019, 1:49pm UTC](https://discuss.elastic.co/t/apm-problem-with-java-standalone/175214 "2019-04-03T13:49:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaryFu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maryfu/32/46724_2.png) [@MaryFu](https://discuss.elastic.co/u/MaryFu)\
**Post date:** [April 3, 2019, 1:49pm UTC](https://discuss.elastic.co/t/apm-problem-with-java-standalone/175214/1 "2019-04-03T13:49:51Z")

</div>

Hi all,

I have a couple of Java application which comunicate with rmi. One of them has a part web. I can see document from Jboss (2 server) to MySQL (3 server) in apm dashboard as a service.  
But the part of from daemon (1 server) to Jboss (2 server) it seems to be missing, I only get metric documents but I'm unable to see APM information.

![Untitled%20Diagram%20(1)](https://us1.discourse-cdn.com/elastic/original/3X/6/f/6f90b90a47835014cb26e2f070731871cf4e63b7.png)

Thank you very much in advance

---

<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:** [April 3, 2019, 2:02pm UTC](https://discuss.elastic.co/t/apm-problem-with-java-standalone/175214/2 "2019-04-03T14:02:08Z")

</div>

Hi and welcome to the forum 🎉

The Java agent currently does not support RMI out of the box. You can, however, use the [public API](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html) to manually create a transaction for your daemon service.

If you want to directly correlate the daemon activity with the requests to JBoss and the subsequent activity, you have to manually propagate the relevant tracing headers. In the daemon, create a transaction, either with the programmatic API or via an annotation. Then use the [`injectTraceHeaders`](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-transaction-inject-trace-headers) API to inject the relevant headers in a `Map`. Add this map to your RMI interface method. In JBoss, manually create a transaction for the RMI call via [`ElasticApm.startTransactionWithRemoteParent`](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-start-transaction-with-remote-parent-header), using the `Map` received from the daemon application.

I hope that helps 🙂

Best,  
Felix

---

<div class="post-metadata">

**Author:** ![MaryFu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maryfu/32/46724_2.png) [@MaryFu](https://discuss.elastic.co/u/MaryFu)\
**Post date:** [April 3, 2019, 2:40pm UTC](https://discuss.elastic.co/t/apm-problem-with-java-standalone/175214/3 "2019-04-03T14:40:22Z")

</div>

Ok, thank you so much.

I only have one question more. The JBoss (2 Server) has scheduled tasks too and I don't see in APM dashboard, I only see web project (.war) but not scheduler project (.jar). Any idea?

---

<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:** [April 3, 2019, 3:11pm UTC](https://discuss.elastic.co/t/apm-problem-with-java-standalone/175214/4 "2019-04-03T15:11:02Z")

</div>

How do you schedule the tasks? Do those methods have something like a `@Scheduled` annotation? We currently don't have out-of-the-box support for that yet but there is a related issue: [https://github.com/elastic/apm-agent-java/issues/418](https://github.com/elastic/apm-agent-java/issues/418)

In the mean time, you can use the [`@CaptureTransaction`](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-annotation) annotation to capture those methods.

---

<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:** [April 24, 2019, 11:11am UTC](https://discuss.elastic.co/t/apm-problem-with-java-standalone/175214/5 "2019-04-24T11:11:02Z")

</div>

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