# Use of Public API for Java application running on Jboss Server as an OSGi container

**URL:** <https://discuss.elastic.co/t/use-of-public-api-for-java-application-running-on-jboss-server-as-an-osgi-container/252299>\
**Category:** APM\
**Tags:** java\
**Created:** [October 16, 2020, 5:33am UTC](https://discuss.elastic.co/t/use-of-public-api-for-java-application-running-on-jboss-server-as-an-osgi-container/252299 "2020-10-16T05:33:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![puja](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@puja](https://discuss.elastic.co/u/puja)\
**Post date:** [October 16, 2020, 5:33am UTC](https://discuss.elastic.co/t/use-of-public-api-for-java-application-running-on-jboss-server-as-an-osgi-container/252299/1 "2020-10-16T05:33:44Z")

</div>

Hi,

I am really sorry, if these questions are too basic, but I am new to java and have no idea from where to start.

Below are the version I am using -

**Kibana version** : 7.7.0

**Elasticsearch version** : 7.7.0

**APM Server version** : 7.7.0

**APM Agent language and version** : 1.16

**Browser version** : Chrome 84.0

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: rpm

**Fresh install or upgraded from other version?** Fresh

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

Below are the version I am using -

**Fuse -** jboss-fuse-6.3.0.redhat-329

**ElasticSearch -** 7.7.0

**Kibana -** 7.7.0

**APM -** 7.7.0

**Servlet** - Undertow

I want to use Public API for java application as JBOSS Fuse is not supported by APM. My application is running on Jboss Fuse as a part of OSGi Container. But I don't know how to proceed.  
I have gone through this link -  
[https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html)

But still I am having several doubts -

**1 - What all jar file do I need to install ?**

**2 - Where to place those jar file ? If I have to add in pom.xml or anywhere else ?**

**3 - It's given to import co.elastic.apm.api.ElasticApm and co.elastic.apm.api.Transaction, so where to add package co.elastic.apm ?**

**4 - Do I need to add bootdelegation, if yes, then where ?**

**5 - Also, in the link, it says to use several API, but where to add those methods and how ?**

**6 - Where to pass flags like - path of jar, server\_urls, log\_level, service\_name etc with javaagent. Do, we need to add it as JAVA\_OPTS in our application.yml or pass it while running the build.**

Is it possible to share any example where public API has been used.

Thanks,  
Puja

---

<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, 1:52pm UTC](https://discuss.elastic.co/t/use-of-public-api-for-java-application-running-on-jboss-server-as-an-osgi-container/252299/2 "2020-10-16T13:52:18Z")

</div>

Hi @puja, there are multiple things involved when you use public API:

- you have to add the public api jar to your application dependencies, likely in your `pom.xml`
- you have to setup the agent at runtime in your environment.

In order to have the manual instrumentation working, you need to successfully do the both, but each can be done separately and in any order.  
I would suggest to start with doing agent setup first, then add the public API to you application. This will allow to check that metrics are being reported and visible in Kibana.

---

<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 6, 2020, 9:52am UTC](https://discuss.elastic.co/t/use-of-public-api-for-java-application-running-on-jboss-server-as-an-osgi-container/252299/3 "2020-11-06T09:52:26Z")

</div>

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