cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

AppMon 7.2 Java 11 java.lang.NoClassDefFoundError: java/sql/Connection

jbentyn1
Newcomer

Hi

I'm using AppMon 7.2 (October 2018) to monitor my applications which are Spring Boot based Java apps.

Recently I updated my apps to use Java 11 and since then I've got problems with running my applications which use databeses (PostgreSQL). When I'm trying to run my applications with Dynatrace agent I get following error message at startup:

Caused by: java.lang.NoClassDefFoundError: java/sql/Connection
    at com.compuware.apm.agent.introspection.jdbc.ConnectionPoolIntrospection.updateConnectionClass(ConnectionPoolIntrospection.java:209)
    at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java)
    at org.postgresql.jdbc.PgConnection.isValid(PgConnection.java:1459)
    at com.zaxxer.hikari.pool.PoolBase.checkValidationSupport(PoolBase.java:454)
    at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:437)
    at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:406)
    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:202)
    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473)
    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:554)
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
    at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:311)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
    ... 138 common frames omitted

I tried to disable JDBC Sensor Pack from default Java system profile and them my app statrs just fine with agent, but ofcourse I'm not able to see any database related metrics.


I've also tried to set com.dynatrace.diagnostics.useReflectionForJDBC=true for connector as mentioned here https://answers.dynatrace.com/questions/189215/getting-javalangnoclassdeffounderror-comdynatraced.ht... But it didn't work.

Could someone help me wit this problem?

I would like to have databese monitoring in my apps since they are very database intense. Maybe there is another way to achive at least some functionality of JDBC sensor if it's not working with Java 11?

I've attached aget run log.

agent_run_log.log

5 REPLIES 5

sebastian_kryst
DynaMight Leader
DynaMight Leader

In general Java 11 should be normally supported by Appmon Agent which is made based on OneAgent. I think you should open support ticket for this particular case.

Sebastian

Hi Sebastian.

Thanks for your answer. Can you tell me how can I oppen such support ticket?

jbentyn1
Newcomer

Hi

After help from support I've managed to fix this bug. I'm adding answer in case somebody else stumble across similar issue.

Firstly I needed to upgrade my AppMonn instalation to newest available. You can find upgrades here https://downloads.dynatrace.com/downloads/download.aspx?p=DT


Then I colud use newest oneagent to connect my applications (you can find it after upgrade in your DYNATRACE_HOME/server/agents directory)


I've also needed to change my -agentpath parameter since I was using outdated config. Change was as following:

From:

-agentpath:${DT_AGENT_PATH}=name=${DT_AGENT_NAME},server=localhost:9998

To

-agentpath:${DT_AGENT_PATH}=name=${DT_AGENT_NAME},collector=localhost

Finally I added -Xshare:off java parameter to my application startup configuration. There was a warning in logs to do so since JVM I'm using automatically enabled class data sharing feature which is not compatible with AppMon.


And after this step my applications started with fully working dynatrace monitoring (including JDBC sensor)


I hope my answer will be helpfull for someone with similar problems.

Regards

Jakub

Thanks for sharing! Side-note: by using the agent platform switch feature a reconfiguration of the agentpath would be unnecessary (see https://www.dynatrace.com/support/doc/appmon/installation/set-up-agents/appmon-agent-configuration/a...). That is also the recommended approach.