Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I am using splunk java logging library and application is able to send logs to splunk server. But when we are starting application so we see below logs and those are very annoying because it gets printed again and again.
Exception in thread "OkHttp Dispatcher" java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement;
at com.splunk.logging.HttpEventCollectorErrorHandler$ServerErrorException.<init>(HttpEventCollectorErrorHandler.java:56)
at com.splunk.logging.HttpEventCollectorSender$3.completed(HttpEventCollectorSender.java:308)
at com.splunk.logging.HttpEventCollectorSender$4.onResponse(HttpEventCollectorSender.java:356)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:141)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "OkHttp Dispatcher" java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement;
at com.splunk.logging.HttpEventCollectorErrorHandler$ServerErrorException.<init>(HttpEventCollectorErrorHandler.java:56)
at com.splunk.logging.HttpEventCollectorSender$3.completed(HttpEventCollectorSender.java:308)
at com.splunk.logging.HttpEventCollectorSender$4.onResponse(HttpEventCollectorSender.java:356)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:141)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)to
–
–
–
Splunk
has com.google.gson
as a dependency. The installation is not detailed in the question but the library is not on the path as detailed in the manual.
gson-2.1.jar contains third-party tokenizers for parsing results for
JSON output. Add this to your build path to display search results in
JSON format using the ResultsReaderJson class.
NoSuchMethodError
reports that the version found is too old for what is attempted. The dependency tree must be verified to locate which version is loaded first.
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.