DSEyers
DSEyers

Reputation: 39

Java error Java_java_lang_ClassLoader_00024NativeLibrary_load0

Have large spring boot app and seeing the following message every few seconds in Kibana logs for Java app.

WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load

I suspect something that has come in between Java 11 OpenJdk version after 22nd Apr 2022 and on/at 25th Apr 2022. 11-jre-slim: Pulling from library/openjdk

Looked in the code and can not see anything standing out. Looked at the Java source code and can see C code (oh no!)

enter image description here

Lots of these:

Showing entries from Apr 25, 20:11:32

  1. 20:11:32.492. WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load
  2. 20:11:37.500. WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load
  3. 20:11:37.702. WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load
  4. 20:11:42.701. WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load
  5. 20:11:42.905. WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load
  6. 20:11:47.913 WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load
  7. 20:11:48.099. WARNING: Could not find Java_java_lang_ClassLoader_00024NativeLibrary_load

Upvotes: 2

Views: 783

Answers (3)

Luca Belluccini
Luca Belluccini

Reputation: 151

For anyone waiting for a fix for this, Elastic APM Agent has been updated to include a new version of async-profiler which avoids the problem on the mentioned JDKs: https://github.com/elastic/apm-agent-java/issues/2759#issuecomment-1246507167

Upvotes: 3

Thomas Stuefe
Thomas Stuefe

Reputation: 472

Highly likely that this is a bug in async-profiler, not in java.

Async profiler does try to intercept NativeLibraries::load resp. load0 and replace the original implementation the JVM provides with its own. See https://github.com/jvm-profiling-tools/async-profiler/blob/5312a793ec22106420883e8a274d10c390e6e4b1/src/profiler.cpp#L582-L615

Not sure if they still do this, but they did for a while.

See comments in bug report https://bugs.openjdk.org/browse/JDK-8288547.

Upvotes: 0

tazdingo
tazdingo

Reputation: 45

We opened a new Bug in Oracle because of this problem. In our case we are using ElasticAPM with java 11.0.15 and that's causing this error. We checked the java source code and found that is probably related to the last changes in openJDK11

Here is the link to the bug in Oracle.

Upvotes: 1

Related Questions