• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    SeroUtils.jar ClassNotFoundException

    Modbus4J general discussion
    2
    6
    3.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      phantom
      last edited by

      com.serotonin.timer.TimeSource

      Using latest CVS

      1 Reply Last reply Reply Quote 0
      • P
        phantom
        last edited by

        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/
        
        1 Reply Last reply Reply Quote 0
        • M
          mlohbihler
          last edited by

          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?

          Best regards,
          Matthew

          1 Reply Last reply Reply Quote 0
          • P
            phantom
            last edited by

            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]
            
            1 Reply Last reply Reply Quote 0
            • M
              mlohbihler
              last edited by

              This is what you need:

              Attachment: download link

              Best regards,
              Matthew

              1 Reply Last reply Reply Quote 0
              • First post
                Last post