dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

WARNING: Illegal reflective access by datadog.trace.instrumentation.java.concurrent.NewTaskFor

Open jonathancouchman opened this issue 6 years ago • 7 comments

The following warnings have started appearing in the start up log of our java application

WARNING: All illegal access operations will be denied in a future release WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: Please consider reporting this to the maintainers of datadog.trace.instrumentation.java.concurrent.NewTaskFor WARNING: Illegal reflective access by datadog.trace.instrumentation.java.concurrent.NewTaskFor to method java.util.concurrent.AbstractExecutorService.newTaskFor(java.lang.Runnable,java.lang.Object) WARNING: An illegal reflective access operation has occurred

We include the dd-java-agent as described here https://docs.datadoghq.com/tracing/setup_overview/setup/java/?tab=containers

The application is executing a spring boot application using spring-boot-starter-parent 2.2.9.RELEASE

It is running inside a docker container extending openjdk:11-jre-slim-buster

We have not previously seen these warnings

jonathancouchman avatar Nov 09 '20 15:11 jonathancouchman

Getting the same error with version 0.67.0:

[dd.trace 2020-11-12 07:42:31:175 -0800] [main] INFO datadog.trace.agent.tooling.AgentInstaller - Class instrumentation installed WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by datadog.trace.instrumentation.java.concurrent.NewTaskFor to method java.util.concurrent.AbstractExecutorService.newTaskFor(java.lang.Runnable,java.lang.Object) WARNING: Please consider reporting this to the maintainers of datadog.trace.instrumentation.java.concurrent.NewTaskFor WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [dd.trace 2020-11-12 07:42:31:773 -0800] [main] INFO datadog.trace.agent.core.StatusLogger - DATADOG TRACER CONFIGURATION {"version":"0.67.0~9daf9ffe6","os_name":"Mac OS X","os_version":"10.15.7","architecture":"x86_64","lang":"jvm","lang_version":"11.0.7","jvm_vendor":"AdoptOpenJDK","jvm_version":"11.0.7+10","java_class_version":"55.0","http_nonProxyHosts":"local|.local|169.254/16|.169.254/16","http_proxyHost":"null","enabled":true,"service":"jamacore","agent_url":"http://192.168.1.38:8126","agent_error":false,"debug":false,"analytics_enabled":false,"sampling_rules":[{},{}],"priority_sampling_enabled":true,"logs_correlation_enabled":false,"profiling_enabled":false,"dd_version":"0.67.0~9daf9ffe6","health_checks_enabled":true,"configuration_file":"no config file present","runtime_id":"3b395f23-0e1d-4448-9d75-b5e3c255e999"}

kpuranik-jama avatar Nov 12 '20 15:11 kpuranik-jama

We're also seeing this, and here's our DD java agent config if that helps:

[dd.trace 2020-11-16 21:56:03:867 +0000] [main] INFO datadog.trace.agent.core.StatusLogger - DATADOG TRACER CONFIGURATION 
{
    "version": "0.67.0~9daf9ffe6",
    "os_name": "Linux",
    "os_version": "4.14.193-149.317.amzn2.x86_64",
    "architecture": "amd64",
    "lang": "jvm",
    "lang_version": "11.0.2",
    "jvm_vendor": "Oracle Corporation",
    "jvm_version": "11.0.2+9-Debian-3bpo91",
    "java_class_version": "55.0",
    "http_nonProxyHosts": "null",
    "http_proxyHost": "null",
    "enabled": true,
    "service": "clojure.main",
    "agent_url": "http://localhost:8126",
    "agent_error": true,
    "debug": false,
    "analytics_enabled": false,
    "sampling_rules": [
        {},
        {}
    ],
    "priority_sampling_enabled": true,
    "logs_correlation_enabled": false,
    "profiling_enabled": false,
    "dd_version": "0.67.0~9daf9ffe6",
    "health_checks_enabled": true,
    "configuration_file": "no config file present",
    "runtime_id": "412742c5-6cbb-4a99-925c-e24699e69b7e"
}

futuro avatar Nov 17 '20 19:11 futuro

Seeing a similar error WARNING: Illegal reflective access by datadog.trace.instrumentation.java.concurrent.NewTaskFor to method java.util.concurrent.AbstractExecutorService.newTaskFor(java.lang.Runnable,java.lang.Object)

collardmsc avatar Nov 26 '20 02:11 collardmsc

Any update on how to fix that issue?

kolszewska avatar Dec 07 '20 11:12 kolszewska

A fix is in progress. Note that this JDK warning doesn't have any functional impact on either the application or the tracer and can be safely ignored. Recent JDKs output this warning as a reminder to migrate from the older reflection API to alternative approaches.

You can remove this warning by adding the following JVM option:

--add-opens java.base/java.util.concurrent=ALL-UNNAMED

mcculls avatar Dec 07 '20 12:12 mcculls

FYI, I've merged a fix for this warning in #2199 which will be in the next release (0.70.0)

mcculls avatar Dec 15 '20 09:12 mcculls

:robot: This issue has been addressed in the latest release. See full details in the Release Notes.

github-actions[bot] avatar Dec 18 '20 16:12 github-actions[bot]