When this error occurs, we should look at the following error message. Only this error is meaningless. What I see here is a java.lang.NoSuchMethodError. This error tells us that the method does not exist. The reason for this error may be that the package has not been introduced, or it may be a version conflict, resulting in the method not being found.
But the errors you may make are not like this, so you can search like this:
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)
Today, adding Swagger2 to the project resulted in an error during project operation:
2019-05-06 15:05:02.348 [pool-2-thread-1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task.
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V
at org.openqa.selenium.remote.service.DriverService$Builder.usingPort(DriverService.java:278)
at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:212)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:172)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:146)
at com.unionpay.aiexamine.services.AutoLoginService.getCookie(AutoLoginService.java:23)
at com.unionpay.aiexamine.config.SaticScheduleTask.getCookie(SaticScheduleTask.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
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)
Solution: add the following codes in the project maven
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.2.2</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
Read More:
- [Solved] SpringBoot Task Error: Unexpected error occurred in scheduled task
- o.s.boot.SpringApplication, Error creating bean with name ‘paymentImpl‘, xml Configuration file error
- [Solved] Spring boot Run Error: o.s.b.d.LoggingFailureAnalysisReporter ERROR;
- [Solved] Springboot connect MySQL error: errorcode 0, state 08s01
- Springboot integration RabbitMQ times error: Failed to check/redeclare auto-delete queue(s).
- Uncaught SyntaxError: Unexpected token o in JSON at position 1 [How to Solve]
- [Solved] o2o Error: addShopImg error:null / character to be escaped is missing
- Jjwt error: ERROR 9856 — [nio-8083-exec-2] o.a.c.c. [. [. [. [/]. [dispatch server]
- [Solved] Error: A JNI error has occurred, please check your installation and try again Exception in thread
- Jmeter Error: ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
- [Solved] O2oa compile error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- [Solved] spingboot Error: I/O error on POST request for “9411/api/v2/spans“: connect timed out
- [Solved] Execution failed for task ‘:app:uploadCrashlyticsMappingFileRelease‘
- [Solved] Jxls error: Cannot load XLS transformer. Please make sure a Transformer implementation is in classpath
- How to Solve Flynk Task Java verifyerror 209 error
- [Solved] springCloud Startup Error: Error creating bean with name ‘defaultValidator‘ defined in class path resource
- [Solved] Could not find resource COM / atguigu / Dao / studentdao.xm, the mapper file for storing SQL statements could not be found and an error occurred
- [Solved] android Execution failed for task ‘:app:processDebugManifest‘
- Doris streamload task reported an error connection reset [How to Solve]
- [Solved] java Internal error in the mapping processor java.lang.NullPointerException