SeroUtils.jar ClassNotFoundException
-
com.serotonin.timer.TimeSource
Using latest CVS
-
Hacked together my own fix for the time being
package com.serotonin.timer; public interface TimeSource { long currentTimeMillis(); }
package com.serotonin.timer; public class SystemTimeSource implements TimeSource { @Override public long currentTimeMillis() { return System.currentTimeMillis(); } }
injected into seroUtils.jar
jar uf seroUtils.jar com/serotonin/timer/
-
Weird. Modbus4J doesn't reference TimeSource AFAICT, and seroUtils is internally consistent, so i'm not sure how you would have gotten this error. Can you provide the full stack trace?
-
Caused by: java.lang.NoClassDefFoundError: com/serotonin/timer/TimeSource at com.serotonin.modbus4j.ModbusMaster.getMessageControl(ModbusMaster.java:302) at com.serotonin.modbus4j.serial.rtu.RtuMaster.init(RtuMaster.java:48) Caused by: java.lang.ClassNotFoundException: com.serotonin.timer.TimeSource at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 6 more
From the class view provided by eclipse on MessageControl.class I can clearly see
// Field descriptor #99 Lcom/serotonin/timer/TimeSource; private com.serotonin.timer.TimeSource timeSource;
and its constructor
39 aload_0 [this] 40 new com.serotonin.timer.SystemTimeSource [11] 43 dup 44 invokespecial com.serotonin.timer.SystemTimeSource() [12] 47 putfield com.serotonin.messaging.MessageControl.timeSource : com.serotonin.timer.TimeSource [13]
-
This is what you need:
Attachment: download link