I am currently playing with Elastic Stack and APM. I have installed ElasticSearch 6.4.3 and APM-Server 6.5.0 without errors.
On a tomcat 8.0.x I added the following options:
-javaagent:/home/user/apm-server-6.5.0-linux-x86_64/elastic-apm-agent-1.0.0.jar
-Delastic.apm.service_name=DEV-TOMCAT
-Delastic.apm.application_packages=com.myPackage
-Delastic.apm.server_urls=http://127.0.0.1:8200"
Without those settings everything is fine but with them the following error occurs:
org.springframework.web.context.support.XmlWebApplicationContext- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authutil' defined in ServletContext resource [/WEB-INF/applicationContext-auth.xml]: Initialization of bean failed; nested exception is java.lang.VerifyError: (class: org/apache/commons/dbcp/DelegatingStatement, method: executeQuery signature: (Ljava/lang/String;)Ljava/sql/ResultSet;) Illegal type in constant pool
The application uses Spring 4(no spring boot) and apache commons dbcp 2.2.0.
Any hints what I am doing wrong? Can I not use dbcp when using apm?
I'm sorry you are having troubles with it. I have just tested pretty much all dbcp and dbcp2 versions but was not able to reproduce the problem.
That indicates that you are not using dbcp2 but dbcp because otherwise the class name would be org/apache/commons/dbcp2/DelegatingStatement (notice the dbcp2). But dbcp does not have a version 2.2.0. Could you recheck that again?
Thanks for the fast response. We are using Tomcat 8.0.51 running under openJDK 11 on "Red Hat Enterprise Linux Server release 6.10" - might that be the problem? We are currently evaluating running openJDK because of the oracle license change...
Could you try out dbcp 1.4? This version is compiled against Java 1.6 whereas dbcp 1.3 has been compiled against Java 1.4 which Byte Buddy (the bytecode manipulation framework we are using) does not support.
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.