ApplicationInsights-Java
ApplicationInsights-Java copied to clipboard
Can't load log handler "com.microsoft.applicationinsights.TelemetryClient" - AI 3.5.2 in Java
Expected behavior
No error.
Actual behavior
2024-05-09 00:08:32.520+05:30 WARN c.a.c.h.netty.implementation.Utility - The following Netty dependencies have versions that do not match the versions specified in the azure-core-http-netty pom.xml file. This may result in unexpected behavior. If your application runs without issue this message can be ignored, otherwise please update the Netty dependencies to match the versions specified in the pom.xml file. Versions found in runtime: 'io.netty:netty-common' version not found (expected: 4.1.101.Final),'io.netty:netty-handler' version not found (expected: 4.1.101.Final),'io.netty:netty-handler-proxy' version not found (expected: 4.1.101.Final),'io.netty:netty-buffer' version not found (expected: 4.1.101.Final),'io.netty:netty-codec' version not found (expected: 4.1.101.Final),'io.netty:netty-codec-http' version not found (expected: 4.1.101.Final),'io.netty:netty-codec-http2' version not found (expected: 4.1.101.Final) 2024-05-09 00:08:40.416+05:30 INFO c.m.applicationinsights.agent - Application Insights Java Agent 3.5.2 started successfully (PID 36100, JVM running for 14.524 s) 2024-05-09 00:08:40.418+05:30 INFO c.m.applicationinsights.agent - Java version: 1.8.0_202, vendor: Oracle Corporation, home: C:\Program Files\Java\jdk1.8.0_202\jre Can't load log handler "com.microsoft.applicationinsights.TelemetryClient" java.lang.ClassNotFoundException: com.microsoft.applicationinsights.TelemetryClient java.lang.ClassNotFoundException: com.microsoft.applicationinsights.TelemetryClient at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.util.logging.LogManager$5.run(LogManager.java:965) at java.security.AccessController.doPrivileged(Native Method) at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:958) at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1578) at java.util.logging.LogManager.access$1500(LogManager.java:145) at java.util.logging.LogManager$RootLogger.accessCheckedHandlers(LogManager.java:1667) at java.util.logging.Logger.getHandlers(Logger.java:1777) at java.util.logging.Logger.log(Logger.java:735) at java.util.logging.Logger.doLog(Logger.java:765) at java.util.logging.Logger.log(Logger.java:788) at java.util.logging.Logger.info(Logger.java:1490)
The application is simple hello world type. No maven or gradle. AI jar is kept in subfolder lib in root folder. Added corresponding config file with connection string. Added VM argument to point to java agent 3.5.2 jar. Application produced output as expected but got this error also.
To Reproduce
Submitting a PR with an example reproducing the issue in this repository would make it easier for the Application Insight maintainers to help you. Before doing this, you have to fork this repository.
System information
Please provide the following information:
- SDK Version: 3.5.2
- OS type and version: Windows 11
- Application Server type and version (if applicable):
- Using spring-boot? No
- Additional relevant libraries (with version, if applicable): JDK 8
Logs
Turn on SDK logs and attach/paste them to the issue. If using an application server, also attach any relevant server logs.
Be sure to remove any private information from the logs before posting!
Screenshots
If applicable, add screenshots to help explain your problem.