java.lang.VerifyError with java agent

(Wolfram Haußig) #1


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:

Without those settings everything is fine but with them the following error occurs: 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?

Best regards

(Felix Barnsteiner) #2

Hi and thanks for trying out the Java agent!

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?

Which exact Java version and OS are you using?


(Felix Barnsteiner) #3

A link to the exact version you are using on would be helpful :slight_smile:

(Wolfram Haußig) #4

Hello felix,

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...

And you are right, I looked into the wrong application - the legacy applications are using Spring 4 too but instead of dbcp2 they use
Interestingly, the new application using is running fine.

Best regards

(Felix Barnsteiner) #5

Hm, yesterday, I have tried dbcp 1.3 with Open JDK 11. Could you send me the output of java -version so that I can see the exact build you are using?

(Wolfram Haußig) #6

[tomcat@sapc3027 ~]$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

(Felix Barnsteiner) #7

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.

(Wolfram Haußig) #8

Perfect! That was the problem.

Thank you very much!!

(system) #9

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