由於公司是內網,需要使用網上別的大佬的maven jar包時,使用到該方法的時候,總是報:
Unexpected error occurred in scheduled task.
java.lang.NoClassDefFoundError: com/iceyyy/workday/WorkUtils
at com.cattsoft.fast.alloverview.utils.SaticScheduleTask.configureTasks(SaticScheduleTask.java:68)
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:65)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
想了很多辦法都沒有解決。
本人使用的工具是idea.
首先本地的pom.xml文件中如下引用:
<dependency>
<groupId>com.icexxx</groupId>
<artifactId>iceworkday</artifactId>
<version>2.0.2.0</version>
<scope>system</scope>
<systemPath>E:/***/com/icexxx/iceworkday/2.0.2.0/iceworkday-2.0.2.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.iceyyy</groupId>
<artifactId>workday</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>E:/***/com/iceyyy/icenongli/2.0/icenongli-2.0.jar</systemPath>
</dependency>
突然想到之前遇到過類似的坑。
解決方案如下:
在idea中:
選擇自己的jar包,點擊ok
然後重新啓動就解決了。