I would test APM java with Tomcat application. My code use Quartz Job scheduler with JDBC connection (MariadDB).
I've configured elk java agent, adding export
2018-07-11 11:55:38,839 [QuartzScheduler_ekContractScheduler-v2-dev1531302937988_MisfireHandler] [ERROR] [o.q.impl.jdbcjobstore.JobStoreTX] - MisfireHandler: Error handling misfires: Failed to obtain DB connection from data source 'ekds': java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/StatementInstrumentation
org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'ekds': java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/StatementInstrumentation
at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:787)
at org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:71)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.doRecoverMisfires(JobStoreSupport.java:3231)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.manage(JobStoreSupport.java:3997)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$MisfireHandler.run(JobStoreSupport.java:4018)
Caused by: java.lang.NoClassDefFoundError: co/elastic/apm/jdbc/StatementInstrumentation
I've try to add apm-jdbc-plugin-0.6.0.jar into $CATALINA_BASE/lib, no success.
Why co/elastic/apm/jdbc/StatementInstrumentation isn't in the classpath ?
Could you send me a small application which reproduces the problem? It would be really awesome if you could do this as I can't reproduce that problem on Tomcat.
Just as a clarification - does the problem occur on Tomcat or on Glassfish? Glassfish is currently not supported and shows the exact same symptoms (NoClassDefFoundError). This is because the OSGi container does not allow access to the agent classes.
What the agent currently does to support other OSGi environments, such as WebSpere, is to set the system property org.osgi.framework.bootdelegation=co.elastic.apm.*. But that somehow does not work on Glassfish and I have yet to find the reason.
Hey, I've recently been adding support for Glassfish. If we are lucky it fixes your problem as well. Could you try with this snapshot version of the agent:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.