Elastic APM latest Java agent does't not work on Tomcat 7


I've followed an elastic document which is to configure agent JAVA in APM. in final steps when tomcat has been restarted then I can see Catalina.out file only shows the below result. unfortunately, my application also not come out.

2020-08-16 11:03:56,213 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean
2020-08-16 11:03:56,404 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.18.0.RC1 as CMS-172-21-95-132 on Java 1.7.0_79 Runtime version: 1.7.0_79-b15 VM version: 24.79-b02 (Oracle Corporation) Linux 3.10.0-1127.el7.x86_64
2020-08-16 11:04:00,398 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state

Tomcat version: Apache Tomcat/7.0.103
Elastic APM version: 7.7
APM Agent version: elastic-apm-agent-1.18.0.RC1.jar

My setenv.sh file

Anybody has got a clue what is going on here?


Hi @smakers and welcome to the forum!

Is the application not running/responding as expected, or is it just not showing up on Kibana?

Hi Eyal,

Thanks for the response. My application also not working.. last logs only showing below screenshot.

but it's working if I remove the APM agent configuration. need your advise.

Sorry about that!

Does the Java process just hang when you launch it, or does it exit immediately?

If it hangs, it could be a deadlock. Please create and upload a thread dump for your Tomcat while it hangs. You can list all running Java process using the jps cmd line tool. Once you located the pid corresponding your Tomcat process, run jstack <pid> > /path/to/thread-dump.log to create a thread dump.

Then, please try adding:

export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.delay_initialization=5000ms"

to your config and see if the problem gets resolved.


i think the process not hung but it's seem application not working due my war application not starting properly.

here are below results from JPS cmd.

however, after I put the parameter as advised by you. It's working now but data did not capture in APM-server.

logs from APM-Server

If you can produce and upload a thread dump as suggested above, that may be very useful to see.

That's because you are using an old Oracle JDBC driver. However, we just added support for Java 1.4 bytecode, so try this snapshot instead.

I can't say why you don't get anything else - could be the same reason.
Also, make sure your application_packages config contains the root package of your application code. If not, you should either remove it or set it right.
In any case, it's much better to provide full logs than partial screenshots.

Looks fine - agent is polling for remote configuration every 30 seconds and sending metrics every 30 seconds.

hi Eyal,

I want to try using new snapshot(.jar) that your shared recently. however, my application unable to start due to below error.

Make sure that the user running the Tomcat has read permissions for the agent jar.

hi Eyal,

it's look I've no issue to use previous jar version.

refer below screenshot, I've put in same folder with previous jar file.

My setting for setenvh.sh

if happened, when i try to start tomcat services. logs in catalina.out file.

Please share logs or parts of logs instead of screenshots.
Also, share your entire agent setting - did you add a dependency somewhere to the agent jar?
The only place you should refer to the agent jar is in the setenv.sh script in the javaagent setting. If anything else is aware of agent jar - remove them.

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