eclipse-leshan / leshan

Java Library for LWM2M
https://www.eclipse.org/leshan/
BSD 3-Clause "New" or "Revised" License
652 stars 407 forks source link

Rejecting re-init on previously-failed class java.lang.Class<org.eclipse.leshan.client.servers.DmServerInfo> #340

Closed zmsoft closed 7 years ago

zmsoft commented 7 years ago

Switch to the master branch, and when integrated into Android, client can boot normally, but it cannot communicate with the server.

Here is my code

    static NetworkConfig config;
    config = new NetworkConfig();
    InputStream input = ObjectLoader.class.getResourceAsStream("/assets/Californium.properties");
    Properties props = new Properties();
    try {
        props.load(input);
        Enumeration en=props.propertyNames();
        while (en.hasMoreElements()) {
            String key=(String) en.nextElement();
            String property=props.getProperty(key);
            config.set(key, property);
            LogUtils.d("min.zhu configs = "+key + "."+property);
        }

    } catch (IOException e) {
        e.printStackTrace();
    }

    LeshanClientBuilder builder = new LeshanClientBuilder(endpoint);
    builder.setNetworkConfig(config);
    final LeshanClient client = builder.build();
    client.start();

Here is the log

05-15 09:47:32.784 26980-26988 I/art: Ignoring second debugger -- accepting and dropping 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = ACK_TIMEOUT_SCALE.2.0 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = USE_STRICT_RESPONSE_MATCHING.false 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = MARK_AND_SWEEP_INTERVAL.10000 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = COAP_SECURE_PORT.5684 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = USE_CONGESTION_CONTROL.false 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = NETWORK_STAGE_SENDER_THREAD_COUNT.4 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = HTTP_SERVER_SOCKET_BUFFER_SIZE.8192 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = NOTIFICATION_REREGISTRATION_BACKOFF.2000 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = LEISURE.5000 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = NSTART.1 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = PROBING_RATE.1.0 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = MAX_RESOURCE_BODY_SIZE.2048 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = NON_LIFETIME.145000 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = TOKEN_SIZE_LIMIT.8 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = UDP_CONNECTOR_RECEIVE_BUFFER.0 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = TCP_CONNECT_TIMEOUT.10000 05-15 09:52:26.304 26980-26980 D/mwqi: min.zhu configs = BLOCKWISE_STATUS_LIFETIME.300000 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = NETWORK_STAGE_RECEIVER_THREAD_COUNT.4 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = PROTOCOL_STAGE_THREAD_COUNT.4 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = MAX_RETRANSMIT.4 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = CONGESTION_CONTROL_ALGORITHM.Cocoa 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = ACK_TIMEOUT.2000 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = TCP_WORKER_THREADS.1 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = NOTIFICATION_CHECK_INTERVAL.86400000 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = MAX_ACTIVE_PEERS.150000 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = NOTIFICATION_CHECK_INTERVAL_COUNT.100 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = HTTP_CACHE_SIZE.32 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = DEDUPLICATOR.DEDUPLICATOR_MARK_AND_SWEEP 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = HTTP_CACHE_RESPONSE_MAX_AGE.86400 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = UDP_CONNECTOR_SEND_BUFFER.0 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = COAP_PORT.5683 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = USE_RANDOM_MID_START.true 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = HTTP_PORT.8080 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = HEALTH_STATUS_PRINT_LEVEL.FINEST 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = ACK_RANDOM_FACTOR.1.5 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = UDP_CONNECTOR_OUT_CAPACITY.2147483647 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = HEALTH_STATUS_INTERVAL.60 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = TCP_CONNECTION_IDLE_TIMEOUT.10 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = MAX_TRANSMIT_WAIT.93000 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = HTTP_SERVER_SOCKET_TIMEOUT.100000 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = MAX_PEER_INACTIVITY_PERIOD.600 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = PREFERRED_BLOCK_SIZE.512 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = EXCHANGE_LIFETIME.247000 05-15 09:52:26.305 26980-26980 D/mwqi: min.zhu configs = CROP_ROTATION_PERIOD.2000 05-15 09:52:26.306 26980-26980 D/mwqi: min.zhu configs = MAX_MESSAGE_SIZE.1024 05-15 09:52:26.306 26980-26980 D/mwqi: min.zhu configs = UDP_CONNECTOR_DATAGRAM_SIZE.2048 05-15 09:52:26.306 26980-26980 D/mwqi: Loading OMA standard object models 05-15 09:52:26.306 26980-26980 I/System.out: min.zhu loadModel filename=LWM2M_Security-v1_0.xml 05-15 09:52:26.306 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Security-v1_0.xml 05-15 09:52:26.312 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.324 26980-26980 I/System.out: loadModel filename=LWM2M_Server-v1_0.xml 05-15 09:52:26.324 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Server-v1_0.xml 05-15 09:52:26.329 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.339 26980-26980 I/System.out: min.zhu loadModel filename=LWM2M_Access_Control-v1_0.xml 05-15 09:52:26.339 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Access_Control-v1_0.xml 05-15 09:52:26.344 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.349 26980-26980 I/System.out: min.zhu loadModel filename=LWM2M_Device-v1_0.xml 05-15 09:52:26.349 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Device-v1_0.xml 05-15 09:52:26.354 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.374 26980-26980 I/System.out: min.zhu loadModel filename=LWM2M_Connectivity_Monitoring-v1_0.xml 05-15 09:52:26.374 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Connectivity_Monitoring-v1_0.xml 05-15 09:52:26.379 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.389 26980-26980 I/System.out: min.zhu loadModel filename=LWM2M_Firmware_Update-v1_0.xml 05-15 09:52:26.389 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Firmware_Update-v1_0.xml 05-15 09:52:26.394 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.402 26980-26980 I/System.out: min.zhu loadModel filename=LWM2M_Location-v1_0.xml 05-15 09:52:26.403 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Location-v1_0.xml 05-15 09:52:26.406 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.412 26980-26980 I/System.out: min.zhu loadModel filename=LWM2M_Connectivity_Statistics-v1_0.xml 05-15 09:52:26.412 26980-26980 D/mwqi: min.zhu fullpath=/assets/models/LWM2M_Connectivity_Statistics-v1_0.xml 05-15 09:52:26.416 26980-26980 D/mwqi: Parsing DDF file {}/assets/models/ 05-15 09:52:26.423 26980-26980 I/System.out: min.zhu loadModel filename=3303.xml 05-15 09:52:26.423 26980-26980 D/mwqi: min.zhu fullpath=/assets/3303.xml 05-15 09:52:26.426 26980-26980 D/mwqi: Parsing DDF file {}/assets 05-15 09:52:26.433 26980-26980 D/mwqi: min.zhu not needBootstarp pskIdentity == null 05-15 09:52:26.434 26980-26980 D/mwqi: min.zhu Create client localAddress=null and localPort=0 05-15 09:52:26.435 26980-26980 D/mwqi: Starting Leshan client ... 05-15 09:52:26.436 26980-26980 I/CoapServer: Starting server 05-15 09:52:26.436 26980-26980 I/CoapEndpoint: Starting endpoint at {0} 05-15 09:52:26.444 26980-26980 I/DTLSConnector: DTLS connector listening on [{0}] with MTU [{1}] using (inbound) datagram buffer size [{2} bytes] 05-15 09:52:26.449 26980-26980 I/CoapEndpoint: Started endpoint at {0} 05-15 09:52:26.450 26980-26980 I/CoapEndpoint: Starting endpoint at {0} 05-15 09:52:26.454 26980-26980 I/CoapEndpoint: Started endpoint at {0} 05-15 09:52:26.454 26980-26980 D/mwqi: Leshan client started [endpoint:{}].zmsoft 05-15 09:52:26.462 26980-8992 I/art: Rejecting re-init on previously-failed class java.lang.Class 05-15 09:53:33.492 26980-26988 I/art: Ignoring second debugger -- accepting and dropping

sbernard31 commented 7 years ago

I don't know what is "An Zhuozhong" ?

I can not explain the "Rejectong re-init on previously-failed ...", I doubt this is a Leshan problem.