3

从 JBoss 5.1 升级到 WildFly 8.2 后,我得到了下一个错误日志。同时 - 一切正常。

2015-07-13 18:28:35,201 EJB default - 2 ERROR [org.jboss.as.ejb3] JBAS014129: Could not restore timer from /srv/wildfly-pc/standalone/data/timer-service-data/....Bean/01521e61-9473-4cf2-b10b-e1def97c1576: java.io.EOFException: Read past end of file
at org.jboss.marshalling.SimpleDataInput.eofOnRead(SimpleDataInput.java:151) [jboss-marshalling-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.SimpleDataInput.readUnsignedByteDirect(SimpleDataInput.java:294) [jboss-marshalling-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.SimpleDataInput.readUnsignedByte(SimpleDataInput.java:249) [jboss-marshalling-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:224) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1746) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1659) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1286) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:224) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadCollectionObject(RiverUnmarshaller.java:180) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObjectArray(RiverUnmarshaller.java:1553) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadArray(RiverUnmarshaller.java:1592) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:330) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:224) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1746) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1659) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1286) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:224) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1746) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1659) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1286) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209) [jboss-marshalling-river-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:76) [jboss-marshalling-1.4.9.Final.jar:1.4.9.Final]
at org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence.loadTimersFromFile(FileTimerPersistence.java:296) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence.getTimers(FileTimerPersistence.java:275) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence.persistTimer(FileTimerPersistence.java:166) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence.persistTimer(FileTimerPersistence.java:149) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.timerservice.TimerServiceImpl.persistTimer(TimerServiceImpl.java:604) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:161) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final]
Caused by: an exception which occurred:
in field trId
in object of type com.......StorageData
in element at index [1] of size [4]
in field second
in object of type com.......Pair
in field info
in object of type org.jboss.as.ejb3.timerservice.persistence.TimerEntity

Pair - 包含两个值(可序列化)

StorageData - 一些数据(Serializable),包括 Long trId 字段

在豆中:

@Resource
private TimerService service;

protected void startAsync(Integer id, Object... params) {
    service.createTimer(0, new Pair<Integer, Object[]>(id, params));
}

如何消除此错误?

4

2 回答 2

4

发现问题 - 对象中的最后一个参数...参数不是可序列化的。

于 2015-07-14T09:13:58.223 回答
1

我的 JBoss EAP 6.4.6 也有同样的问题。我发现 Timer Service 缓存在 JBoss 数据目录中。我只需要删除 timer-service-data 文件夹中的所有文件夹。

于 2016-07-29T11:10:50.003 回答