程序跑了3天,出现java.util.NoSuchElementException异常

程序运行3天,出现java.util.NoSuchElementException异常
[code="java"]
java.util.NoSuchElementException
at java.util.LinkedList.remove(LinkedList.java:788)
at java.util.LinkedList.removeFirst(LinkedList.java:134)
at java.util.LinkedList.poll(LinkedList.java:470)
at com.etopad.netunion.visitorInfo.quartz.SaveVisitorInfoJob.pollWm(SaveVisitorInfoJob.java:118)
at com.etopad.netunion.visitorInfo.quartz.SaveVisitorInfoJob.executeInternal(SaveVisitorInfoJob.java:70)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:531)
[/code]

[code="java"]
if (visitorsNum != 0) {
for (int i = 0; i < visitorsNum; i++) {
saveWmList.add(wmVisitors.poll());
}
}
[/code]
我用poll(),就算LinkedList链表中没数据也是输出null的啊,不会出现java.util.NoSuchElementException异常,程序跑了3天后才出现这个问题的,请问是什么原因?

[code="java"]if (e == header)
throw new NoSuchElementException(); [/code]

异常应该是从这里抛出的把,如果你的异常堆栈没有定位错误的话.
LinkedList不是线程安全的,如果会出现多线程操作的情况,加上同步语句看看还会不会有这个错误

编译有没有错?
如果编译没有错那么很可能是你的jar包冲突或者说jar放错了位置,所以运行是找不到jar包才导致找不到方法

private E remove(Entry e) {
if (e == header)
throw new NoSuchElementException();

    E result = e.element;
e.previous.next = e.next;
e.next.previous = e.previous;
    e.next = e.previous = null;
    e.element = null;
size--;
modCount++;
    return result;
}

源码是这样的

看不太懂
先看看LinkedList的数据结构,会好理解些
我是不太记得那结构了,所以看不懂那逻辑

会不会是多线程引发的问题? :x