Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Request for LeshanServer side exception assistance

Hi brighter,
Did you find any clue about this issue ?
Could you share the code you use at client side ? This could help to diagnostic if the problem is at encoding or decoding time.
Thx
Simon

Le 22/10/2015 17:53, Brighter Agyemang a écrit :
Thanks Bernard, I will try it out.

-Brighter

On 22 October 2015 at 15:00, Simon Bernard <contact@xxxxxxxxxxxxxxx> wrote:
Ok so you probably find a bug in the TlvEncoder or TlvDecoder :/.
You could use the TlvEncoderTest or TlvDecoderTest, this could help to investigate.



Le 22/10/2015 16:54, Brighter Agyemang a écrit :
Thanks very much for the explanation. I am using leshanclient java implementation. Any suggestions on what I should be checking to fix this?

-Brighter

On 22 October 2015 at 14:05, Simon Bernard <contact@xxxxxxxxxxxxxxx> wrote:
Oups sorry I mean :
TLV entry say that the value is 8762 bytes length but there is only 506 bytes remaining in the TLV buffer we try to decode ...


Le 22/10/2015 16:03, Simon Bernard a écrit :
The error is when we try to decode a TLV entry of type RESOURCE_INSTANCE with a 25968 identifier.
TLV entry that the value is 8762 bytes length but there is only 506 bytes remaining in the TLV buffer we try to decode ...

So as your model hasn't any multiple resource, I suspect your Tlv is malformed.
What client did you use ?
Simon

Le 22/10/2015 12:12, Brighter Agyemang a écrit :
Thanks very much for your direction.
Sorry for not mentioning this earlier, I use a different json file that has the current contents of the oma-objects-spec.json and my custom object models of which the 12207 is part of.
Please find attached the object model as found in my json file (12207.txt). What I have done is to use a custom loader to load this as well as other object mdoels from the json file.

Loader method:

public static LwM2mModel loadCustomObjectModel(String objectModelStr) 
    {
        InputStream myJsonStr;
        myJsonStr = LwM2mModelLoader.class.getResourceAsStream(objectModelStr);
        LwM2mModel customModel;
        HashMap<Integer, ObjectModel> map = null;
        if(myJsonStr != null)
        {            
            List<ObjectModel> objectModels = ObjectLoader.loadJsonStream(myJsonStr);
            map = new HashMap<>();
            for (ObjectModel objectModel : objectModels) {
                map.put(objectModel.id, objectModel);
            }
            log.info("file {} successfully loaded",objectModelStr);
        }
        else
        {
            try {
                throw new Exception("Error loading json file");
            } catch (Exception ex) {
                log.error(ex.getMessage());
            }
        }
        customModel = new LwM2mModel(map);
        return customModel;
    } 

So I submit this model when creating an object of the ObjectsInitializer class and it works okay for all other objects but the 12207 after sometime.
I have also attached the message that comes along with the tlvException that is thrown in my log.

Thanks for your assistance

-Brighter

On 22 October 2015 at 17:11, Simon Bernard <contact@xxxxxxxxxxxxxxx> wrote:
Hi Brighter,
  Could you show us the json description of your 12207 object.
  Which client did you use ?
 
  This will not solve your issue, but maybe this could help.
  There is a way for loading custom models in leshan (without tweaking the json file):
    - place your DDF(xml) files or json files  in a directory
    - set the "MODELS_FOLDER" env variable value for pointing where you placed the file (e.g export MODELS_FOLDER=/opt/extra-models)
    - run leshan standalone, it will load the extra model files.

Simon


Le 22/10/2015 10:06, Brighter Agyemang a écrit :
Hello Kai,

Thanks for the attention. By that I mean the file oma-objects-spec.json which comes with leshan-core. From my understanding that is where the object models are kept and loaded from at runtime. What I did was to create a custom object model and gave it the ID 12207 (with its resources as well) so I can use in my project. What I am doing is that I have exposed some services which make use of an instance of LeshanServer class. The server processes all requests concurrently. From my log, the server runs okay for a while then after sometimes these exceptions get thrown.
I hope I have clarified what I was referring to.

Thanks very much.
Best regards,
Brighter

On 22 October 2015 at 15:38, Hudalla Kai (INST/ESY) <Kai.Hudalla@xxxxxxxxxxxx> wrote:

Brighter,

 

Which JSON file are you referring to with

I have extended the JSON file of the objects to include a custom object with id 12207 in my work.

 

Regards,

Kai

 

 

From: leshan-dev-bounces@xxxxxxxxxxx [mailto:leshan-dev-bounces@xxxxxxxxxxx] On Behalf Of Brighter Agyemang
Sent: Thursday, October 22, 2015 3:55 AM
To: leshan developer discussions
Subject: [leshan-dev] Request for LeshanServer side exception assistance

 

Hello,

Please I keep getting this error at the leshanServer side in a project I am working on:

 

Exception in thread "Thread-485" org.eclipse.leshan.core.request.exception.ResourceAccessException: [Unable to decode tlv.] ([/12207/0])

          at org.eclipse.leshan.server.californium.impl.LwM2mResponseBuilder.buildContentResponse(LwM2mResponseBuilder.java:269)

          at org.eclipse.leshan.server.californium.impl.LwM2mResponseBuilder.visit(LwM2mResponseBuilder.java:104)

          at org.eclipse.leshan.core.request.ReadRequest.accept(ReadRequest.java:79)

          at org.eclipse.leshan.server.californium.impl.CaliforniumLwM2mRequestSender$1.buildResponse(CaliforniumLwM2mRequestSender.java:85)

          at org.eclipse.leshan.server.californium.impl.CaliforniumLwM2mRequestSender$SyncRequestObserver.onResponse(CaliforniumLwM2mRequestSender.java:223)

          at org.eclipse.californium.core.coap.Request.setResponse(Request.java:377)

          at org.eclipse.californium.core.server.ServerMessageDeliverer.deliverResponse(ServerMessageDeliverer.java:154)

          at org.eclipse.californium.core.network.stack.CoapStack$StackTopAdapter.receiveResponse(CoapStack.java:191)

          at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98)

          at org.eclipse.californium.core.network.stack.ObserveLayer.receiveResponse(ObserveLayer.java:138)

          at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98)

          at org.eclipse.californium.core.network.stack.BlockwiseLayer.receiveResponse(BlockwiseLayer.java:381)

          at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98)

          at org.eclipse.californium.core.network.stack.TokenLayer.receiveResponse(TokenLayer.java:79)

          at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98)

          at org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveResponse(ReliabilityLayer.java:247)

          at org.eclipse.californium.core.network.stack.AbstractLayer.receiveResponse(AbstractLayer.java:98)

          at org.eclipse.californium.core.network.stack.CoapStack.receiveResponse(CoapStack.java:138)

          at org.eclipse.californium.core.network.CoAPEndpoint$InboxImpl.receiveMessage(CoAPEndpoint.java:619)

          at org.eclipse.californium.core.network.CoAPEndpoint$InboxImpl.access$700(CoAPEndpoint.java:530)

          at org.eclipse.californium.core.network.CoAPEndpoint$InboxImpl$1.run(CoAPEndpoint.java:542)

          at org.eclipse.californium.core.network.CoAPEndpoint$5.run(CoAPEndpoint.java:678)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

          at java.util.concurrent.FutureTask.run(FutureTask.java:266)

          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:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:745)

Caused by: org.eclipse.leshan.core.node.codec.InvalidValueException: Unable to decode tlv.

          at org.eclipse.leshan.core.node.codec.LwM2mNodeDecoder.decode(LwM2mNodeDecoder.java:101)

          at org.eclipse.leshan.server.californium.impl.LwM2mResponseBuilder.buildContentResponse(LwM2mResponseBuilder.java:265)

          ... 28 more

Caused by: org.eclipse.leshan.tlv.TlvException: Impossible to parse TLV

 

I have extended the JSON file of the objects to include a custom object with id 12207 in my work.

 

Please can anyone help with an idea of what may be the cause?...

Thanks a lot in advance


_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev




_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev




_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev



_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev




_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev




_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev


Back to the top