# Elastic apm agent on correto 8 is not starting up

**URL:** <https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120>\
**Category:** APM\
**Tags:** java\
**Created:** [February 9, 2023, 9:44am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120 "2023-02-09T09:44:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_sirugudi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_sirugudi/32/94019_2.png) [@rahul\_sirugudi](https://discuss.elastic.co/u/rahul_sirugudi)\
**Post date:** [February 9, 2023, 9:44am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120/1 "2023-02-09T09:44:28Z")

</div>

We are using Tomcat 8.5 with Corretto 8 in the beanstalk. I have set all my configs properly, when i am deploying the code i am seeing below errors.

```auto
Error opening zip file or JAR manifest missing : /home/ec2-user/elastic-apm-agent-1.36.0.jar
agent library failed to init: instrument

```

Java\_OPS i am using

```auto
 -Xmx4256m -javaagent:/home/ec2-user/elastic-apm-agent-1.16.0.jar -Delastic.apm.service_name

```

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [February 9, 2023, 3:03pm UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120/2 "2023-02-09T15:03:35Z")

</div>

```auto
Error opening zip file or JAR manifest missing : /home/ec2-user/elastic-apm-agent-1.36.0.jar
agent library failed to init: instrument

```

This means that the JVM couldn't find the jar at this path: `/home/ec2-user/elastic-apm-agent-1.36.0.jar`. Please make sure you set your command line properly.  
I don't know why the below says: `-javaagent:/home/ec2-user/elastic-apm-agent-1.16.0.jar`, the error would have been for `1.16.0`. I am also not sure if what you provided is trimmed in the middle, or you really didn't set a value to the `-Delastic.apm.service_name` system property.

This should be an easy fix, it is only a matter of getting the command line right.

---

<div class="post-metadata">

**Author:** ![rahul\_sirugudi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_sirugudi/32/94019_2.png) [@rahul\_sirugudi](https://discuss.elastic.co/u/rahul_sirugudi)\
**Post date:** [February 13, 2023, 5:41am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120/3 "2023-02-13T05:41:01Z")

</div>

i haven't trimmed. This are my JVM\_OPTIONS i have configured.

```auto
-javaagent:"/var/lib/tomcat/webapps/elastic-apm-agent-1.36.0.jar" -Delastic.apm.service_name=nonprodqa-api -Delastic.apm.server_urls=http://url:8200 -Delastic.apm.environment=nonprodqa

```

Tomcat is failing to start. with the below error.

Am i missing any quotes here?

```auto
Feb 13 05:38:33 ip-10-0-1-5.us-west-2.compute.internal server[6037]: arguments used: start
Feb 13 05:38:33 ip-10-0-1-5.us-west-2.compute.internal server[6037]: Error opening zip file or JAR manifest missing : /var/lib/tomcat/webapps/elastic-apm-agent-1.36.0.jar -Delastic.apm.service_name
Feb 13 05:38:33 ip-10-0-1-5.us-west-2.compute.internal server[6037]: Error occurred during initialization of VM
Feb 13 05:38:33 ip-10-0-1-5.us-west-2.compute.internal server[6037]: agent library failed to init: instrument

```

---

<div class="post-metadata">

**Author:** ![rahul\_sirugudi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_sirugudi/32/94019_2.png) [@rahul\_sirugudi](https://discuss.elastic.co/u/rahul_sirugudi)\
**Post date:** [February 13, 2023, 6:25am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120/4 "2023-02-13T06:25:30Z")

</div>

I am able to fix the issue with below configuration.

```auto
-javaagent:/var/lib/tomcat/webapps/elastic-apm-agent-1.36.0.jar -Delastic.apm.service_name=nonprodqa -Delastic.apm.application_packages=org.example -Delastic.apm.server_urls=http://10.0.1.180:8200

```

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [February 13, 2023, 6:28am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120/5 "2023-02-13T06:28:56Z")

</div>

I am not familiar with `JVM_OPTIONS`, so I cannot say whether this is the right one.  
I normally use `CATALINA_OPTS`, which is appended only when using the startup script with `start`.

In your last comment there is a bigger problem, where you added the agent to the `webapps` folder.  
The agent jar should never be loaded by the application other than through the `-javaagent` command! Make sure you move it from the `webapps` folder and any other folder from which jars are loaded by the app. It should also not be a dependency anywhere in your project.

Please revert all changes you did, move the agent to a separate directory (like `/home/ec2-user/elastic-apm-agent-1.36.0.jar`) and follow our [documentation](https://www.elastic.co/guide/en/apm/agent/java/current/setup-javaagent.html#setup-tomcat). This should work. Your errors clearly indicate that the command line that gets built by the startup script is erroneous, so you will have to make sure you get it right.

---

<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:** [March 6, 2023, 2:29am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-correto-8-is-not-starting-up/325120/6 "2023-03-06T02:29:11Z")

</div>

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