Line import java.sql.Date; should be replaced with import java.util.Date; (DeviceEnabled.java).
Using java.sql.Date is not supported by Leshan and causes following exception:
java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
at io.github.malczuuu.iemu.lwm2m.DeviceEnabler.write(DeviceEnabler.java:137)
at org.eclipse.leshan.client.resource.ObjectEnabler.doWrite(ObjectEnabler.java:219)
at org.eclipse.leshan.client.resource.BaseObjectEnabler.write(BaseObjectEnabler.java:203)
at org.eclipse.leshan.client.californium.impl.ObjectResource.handlePUT(ObjectResource.java:239)
at org.eclipse.californium.core.CoapResource.handleRequest(CoapResource.java:220)
at org.eclipse.leshan.client.californium.impl.ObjectResource.handleRequest(ObjectResource.java:100)
at org.eclipse.californium.core.server.ServerMessageDeliverer.deliverRequest(ServerMessageDeliverer.java:108)
at org.eclipse.californium.core.network.stack.BaseCoapStack$StackTopAdapter.receiveRequest(BaseCoapStack.java:158)
at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:81)
at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:81)
at org.eclipse.californium.core.network.stack.BlockwiseLayer.receiveRequest(BlockwiseLayer.java:372)
at org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveRequest(ReliabilityLayer.java:261)
at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:81)
at org.eclipse.californium.core.network.stack.BaseCoapStack.receiveRequest(BaseCoapStack.java:98)
at org.eclipse.californium.core.network.CoapEndpoint$InboxImpl$2.runStriped(CoapEndpoint.java:921)
at org.eclipse.californium.core.network.StripedExchangeJob.run(StripedExchangeJob.java:65)
at eu.javaspecialists.tjsn.concurrency.stripedexecutor.StripedExecutorService$SerialJob.run(StripedExecutorService.java:548)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Line
import java.sql.Date;
should be replaced withimport java.util.Date;
(DeviceEnabled.java).Using
java.sql.Date
is not supported by Leshan and causes following exception: