Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Leshan Client on start throws Exception in thread "DTLS-Receiver" java.lang.NoSuchMethodError

Hi,

Just some more information. This error happens when I try to use the secured connection. In unsecured mode, it works fine.

On the leshan demo server (hosted by Eclipse). I use the identity "mypskid" and the psk "aabbccdd". In my leshan client implementation, because I didn't use command line, so I just directly convert the identity and psk from string like this:

private final static String pskIdentityDefault = "mypskid";
private final static String pskKeyDefault = "aabbccdd";

pskId = pskIdentityDefault.getBytes();
pskKey = Hex.decodeHex(pskKeyDefault.toCharArray());

The dependencies I used for my maven project is at the latest version 1.0.0-M3. I literally implement my client based on the Leshan demo so I am not sure what is causing the exception.

Thank you in advance.

Best regards,
T.Q.Nguyen


2017-08-10 11:09 GMT+02:00 Thong Q. Nguyen <quocthong.ng@xxxxxxxxx>:
Hi, I am following the Leshan demo client to develop my own client. When I try to connect my client to the secure sandbox server. It throws the exception as I described in the title. The full error log from the terminal is bellow;

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Aug 10, 2017 11:01:58 AM org.eclipse.californium.core.network.config.NetworkConfig load
INFO: loading properties from file /home/cloud/iot-workspace/gateway/Californium.properties
Aug 10, 2017 11:01:58 AM org.eclipse.californium.core.CoapServer start
INFO: Starting server
Aug 10, 2017 11:01:58 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at coaps://0.0.0.0:0
Aug 10, 2017 11:01:58 AM org.eclipse.californium.scandium.DTLSConnector start
INFO: DTLS connector listening on [0.0.0.0/0.0.0.0:43978] with MTU [1,280] using (inbound) datagram buffer size [16,474 bytes]
Aug 10, 2017 11:01:58 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Started endpoint at coaps://0.0.0.0:43978
Aug 10, 2017 11:01:58 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at coap://0.0.0.0:0
Aug 10, 2017 11:01:58 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Started endpoint at coap://0.0.0.0:60394
Exception in thread "DTLS-Receiver-0.0.0.0/0.0.0.0:43978" java.lang.NoSuchMethodError: org.eclipse.californium.elements.RawData.getMessageCallback()Lorg/eclipse/californium/elements/MessageCallback;
    at org.eclipse.californium.scandium.DTLSConnector.sendMessage(DTLSConnector.java:1240)
    at org.eclipse.californium.scandium.DTLSConnector.access$500(DTLSConnector.java:117)
    at org.eclipse.californium.scandium.DTLSConnector$5.sessionEstablished(DTLSConnector.java:1285)
    at org.eclipse.californium.scandium.dtls.Handshaker.sessionEstablished(Handshaker.java:871)
    at org.eclipse.californium.scandium.dtls.ClientHandshaker.receivedServerFinished(ClientHandshaker.java:285)
    at org.eclipse.californium.scandium.dtls.ClientHandshaker.doProcessMessage(ClientHandshaker.java:251)
    at org.eclipse.californium.scandium.dtls.Handshaker.processMessage(Handshaker.java:406)
    at org.eclipse.californium.scandium.DTLSConnector.processOngoingHandshakeMessage(DTLSConnector.java:812)
    at org.eclipse.californium.scandium.DTLSConnector.processDecryptedHandshakeMessage(DTLSConnector.java:799)
    at org.eclipse.californium.scandium.DTLSConnector.processHandshakeRecordWithConnection(DTLSConnector.java:783)
    at org.eclipse.californium.scandium.DTLSConnector.processHandshakeRecord(DTLSConnector.java:719)
    at org.eclipse.californium.scandium.DTLSConnector.receiveNextDatagramFromNetwork(DTLSConnector.java:448)
    at org.eclipse.californium.scandium.DTLSConnector.access$200(DTLSConnector.java:117)
    at org.eclipse.californium.scandium.DTLSConnector$3.doWork(DTLSConnector.java:330)
    at org.eclipse.californium.scandium.DTLSConnector$Worker.run(DTLSConnector.java:1571)


It seems that the CoapEndpoint started two times and it bounded to two different ports, and the thread with the first port always threw the exception. I tried to find it out but couldn't find any possibility, hope you can give me some advice. The full code for that class is included in this link if you need some references.

Thank you for your help.

Best regards,
T.Q.Nguyen



Back to the top