You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am following along with this tutorial to implement Splunk with SpringBoot (ApplicationRunner) by using the splunk-library-javalogging version 1.8.0. Below is the log4j2-spring.xml.
When I run the application locally, I get this error java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder:
2023-03-03 10:58:12,124 main ERROR Unable to invoke factory method in class com.splunk.logging.HttpEventCollectorLog4jAppender for element SplunkHttp: java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:138)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1122)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1047)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1039)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:249)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:295)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadConfiguration(Log4J2LoggingSystem.java:227)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadConfiguration(Log4J2LoggingSystem.java:193)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:80)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.initialize(Log4J2LoggingSystem.java:169)
............
Caused by: java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder
at com.splunk.logging.HttpEventCollectorSender.<clinit>(HttpEventCollectorSender.java:46)
at com.splunk.logging.HttpEventCollectorLog4jAppender.<init>(HttpEventCollectorLog4jAppender.java:86)
at com.splunk.logging.HttpEventCollectorLog4jAppender.createAppender(HttpEventCollectorLog4jAppender.java:191)
When I include the maven dependency for Gson, I get this error java.lang.NoClassDefFoundError: okhttp3/OkHttpClient$Builder
Exception in thread "Timer-0" java.lang.NoClassDefFoundError: okhttp3/OkHttpClient$Builder
at com.splunk.logging.HttpEventCollectorSender.startHttpClient(HttpEventCollectorSender.java:255)
at com.splunk.logging.HttpEventCollectorSender.postEvents(HttpEventCollectorSender.java:325)
After including both dependencies and running, the application is stuck.
When I run it EKS without the above dependencies, I get this error java.lang.NoClassDefFoundError: okhttp3/Callback:
2023-03-03 05:05:22,436 main ERROR Unable to invoke factory method in class com.splunk.logging.HttpEventCollectorLog4jAppender for element SplunkHttp: java.lang.NoClassDefFoundError: okhttp3/Callback java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:138)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1122)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1047)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1039)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:249)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:295)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:285)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadConfiguration(Log4J2LoggingSystem.java:227)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadConfiguration(Log4J2LoggingSystem.java:193)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:80)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.initialize(Log4J2LoggingSystem.java:169)
..................
Caused by: java.lang.NoClassDefFoundError: okhttp3/Callback
at com.splunk.logging.HttpEventCollectorLog4jAppender.<init>(HttpEventCollectorLog4jAppender.java:86)
at com.splunk.logging.HttpEventCollectorLog4jAppender.createAppender(HttpEventCollectorLog4jAppender.java:191)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
The text was updated successfully, but these errors were encountered:
Operating System: MacOS Ventura 13.2.1
I am following along with this tutorial to implement Splunk with SpringBoot (ApplicationRunner) by using the
splunk-library-javalogging
version1.8.0
. Below is thelog4j2-spring.xml
.When I run the application locally, I get this error
java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder
:When I include the maven dependency for Gson, I get this error
java.lang.NoClassDefFoundError: okhttp3/OkHttpClient$Builder
After including both dependencies and running, the application is stuck.
When I run it EKS without the above dependencies, I get this error
java.lang.NoClassDefFoundError: okhttp3/Callback
:The text was updated successfully, but these errors were encountered: