Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate about some Exception in logs of sandbox demos #1502

Closed
sbernard31 opened this issue Aug 31, 2023 · 3 comments
Closed

Investigate about some Exception in logs of sandbox demos #1502

sbernard31 opened this issue Aug 31, 2023 · 3 comments
Labels
housekeeping Refactoring, cleaning code or API sandbox relative to leshan sandbox : https://leshan.eclipseprojects.io

Comments

@sbernard31
Copy link
Contributor

Following :

I take a look at logs and find those exceptions which happen regularly :

java.lang.NullPointerException: null
	at org.eclipse.leshan.core.node.LwM2mPath.hashCode(LwM2mPath.java:336)
	at java.util.HashMap.hash(HashMap.java:339)
	at java.util.HashMap.put(HashMap.java:612)
	at org.eclipse.leshan.core.node.codec.senml.LwM2mNodeSenMLDecoder.groupByPath(LwM2mNodeSenMLDecoder.java:322)
	at org.eclipse.leshan.core.node.codec.senml.LwM2mNodeSenMLDecoder.decodeNodes(LwM2mNodeSenMLDecoder.java:130)
	at org.eclipse.leshan.core.node.codec.DefaultLwM2mDecoder.decodeNodes(DefaultLwM2mDecoder.java:178)
	at org.eclipse.leshan.server.californium.request.LwM2mResponseBuilder.decodeCompositeCoapResponse(LwM2mResponseBuilder.java:506)
	at org.eclipse.leshan.server.californium.request.LwM2mResponseBuilder.visit(LwM2mResponseBuilder.java:307)
	at org.eclipse.leshan.core.request.ReadCompositeRequest.accept(ReadCompositeRequest.java:105)
	at org.eclipse.leshan.server.californium.endpoint.ServerCoapMessageTranslator.createLwM2mResponse(ServerCoapMessageTranslator.java:75)
	at org.eclipse.leshan.server.californium.endpoint.CaliforniumServerEndpoint$1.buildResponse(CaliforniumServerEndpoint.java:111)
	at org.eclipse.leshan.core.californium.SyncRequestObserver.waitForResponse(SyncRequestObserver.java:55)
	at org.eclipse.leshan.server.californium.endpoint.CaliforniumServerEndpoint.send(CaliforniumServerEndpoint.java:137)
	at org.eclipse.leshan.server.request.DefaultDownlinkRequestSender.send(DefaultDownlinkRequestSender.java:93)
	at org.eclipse.leshan.server.queue.QueueModeLwM2mRequestSender.send(QueueModeLwM2mRequestSender.java:60)
	at org.eclipse.leshan.server.LeshanServer.send(LeshanServer.java:467)
	at org.eclipse.leshan.server.LeshanServer.send(LeshanServer.java:440)
2023-08-29 07:47:59,027 WARN ClientServlet - Unexpected exception
org.eclipse.leshan.core.link.attributes.InvalidAttributeException: Cannot parse query param 'pmin=10&pmax=20'
	at org.eclipse.leshan.core.link.lwm2m.attributes.DefaultLwM2mAttributeParser.parseQueryParams(DefaultLwM2mAttributeParser.java:67)
	at org.eclipse.leshan.core.link.lwm2m.attributes.DefaultLwM2mAttributeParser.parseQueryParams(DefaultLwM2mAttributeParser.java:51)
	at org.eclipse.leshan.server.demo.servlet.ClientServlet.doPut(ClientServlet.java:333)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
2023-08-29 07:44:20,836 ERROR SendableResponse - Exception while calling the reponse sent callback
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.eclipse.leshan.core.LwM2m$Version and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.eclipse.leshan.server.demo.servlet.EventServlet$RegUpdate["update"]->org.eclipse.leshan.server.registration.RegistrationUpdate["supportedObjects"]->java.util.HashMap["1"])
	at org.eclipse.leshan.server.demo.servlet.EventServlet$1.updated(EventServlet.java:123)
	at org.eclipse.leshan.server.registration.RegistrationServiceImpl.fireUpdated(RegistrationServiceImpl.java:87)
	at org.eclipse.leshan.server.registration.RegistrationHandler$2.run(RegistrationHandler.java:165)
	at org.eclipse.leshan.core.response.SendableResponse.sent(SendableResponse.java:47)
	at org.eclipse.leshan.server.californium.registration.RegisterResource.handleUpdate(RegisterResource.java:247)
	at org.eclipse.leshan.server.californium.registration.RegisterResource.handlePOST(RegisterResource.java:108)
	at org.eclipse.californium.core.CoapResource.handleRequest(CoapResource.java:261)
	at org.eclipse.leshan.core.californium.LwM2mCoapResource.handleRequest(LwM2mCoapResource.java:58)
	at org.eclipse.californium.core.server.ServerMessageDeliverer.deliverRequest(ServerMessageDeliverer.java:133)
	at org.eclipse.californium.core.network.stack.BaseCoapStack$StackTopAdapter.receiveRequest(BaseCoapStack.java:204)
	at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:84)
	at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:84)
	at org.eclipse.californium.core.network.stack.BlockwiseLayer.receiveRequest(BlockwiseLayer.java:578)
	at org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveRequest(ReliabilityLayer.java:296)
	at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:84)
	at org.eclipse.californium.core.network.stack.BaseCoapStack.receiveRequest(BaseCoapStack.java:126)
	at org.eclipse.californium.core.network.CoapEndpoint$1.receiveRequest(CoapEndpoint.java:310)
	at org.eclipse.californium.core.network.UdpMatcher$2.run(UdpMatcher.java:289)
	at org.eclipse.californium.elements.util.SerialExecutor$1.run(SerialExecutor.java:292)
	at org.eclipse.californium.core.network.CoapEndpoint$6.run(CoapEndpoint.java:1367)
	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:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.eclipse.leshan.core.LwM2m$Version and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.eclipse.leshan.server.demo.servlet.EventServlet$RegUpdate["update"]->org.eclipse.leshan.server.registration.RegistrationUpdate["supportedObjects"]->java.util.HashMap["1"])
	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1308)
	at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:414)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:53)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:30)
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeOptionalFields(MapSerializer.java:869)
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:760)
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:720)
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:35)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:479)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:318)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4719)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3964)
	at org.eclipse.leshan.server.demo.servlet.EventServlet$1.updated(EventServlet.java:121)
	... 26 common frames omitted

We need to investigate.

@sbernard31 sbernard31 added housekeeping Refactoring, cleaning code or API sandbox relative to leshan sandbox : https://leshan.eclipseprojects.io labels Aug 31, 2023
@sbernard31
Copy link
Contributor Author

sbernard31 commented Sep 1, 2023

NPE in hashcode should be fixed by : #1505

~This should probably be backport in 1.x too. ~

The fix for 1.x is at : 74caa9d

@sbernard31
Copy link
Contributor Author

InvalidAttributeException must be fixed by : 9e14443
InvalidDefinitionException must be fixed by : 749d698

Not need to backport to 1.x

@sbernard31
Copy link
Contributor Author

All exceptions are now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, cleaning code or API sandbox relative to leshan sandbox : https://leshan.eclipseprojects.io
Projects
None yet
Development

No branches or pull requests

1 participant