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

[Question] "ERROR SendableResponse" when running demo #1196

Closed
vtran5 opened this issue Jan 9, 2022 · 2 comments
Closed

[Question] "ERROR SendableResponse" when running demo #1196

vtran5 opened this issue Jan 9, 2022 · 2 comments
Labels
question Any question about leshan

Comments

@vtran5
Copy link

vtran5 commented Jan 9, 2022

When I tried to run the Leshan server - client demo, I got an error: "ERROR SendableResponse - Exception while calling the reponse sent callback". It happens whenever the client register/update registration, even though the client's log says the registration update succeed. The full server's log of the error is below:

ERROR SendableResponse - Exception while calling the reponse sent callback
java.lang.reflect.InaccessibleObjectException: Unable to make private java.util.Collections$EmptyMap() accessible: module java.base does not "opens java.util" to unnamed module @dc9876b
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
at com.google.gson.internal.reflect.UnsafeReflectionAccessor.makeAccessible(UnsafeReflectionAccessor.java:44)
at com.google.gson.internal.ConstructorConstructor.newDefaultConstructor(ConstructorConstructor.java:103)
at com.google.gson.internal.ConstructorConstructor.get(ConstructorConstructor.java:85)
at com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:127)
at com.google.gson.Gson.getAdapter(Gson.java:489)
at com.google.gson.Gson.toJson(Gson.java:727)
at com.google.gson.Gson.toJsonTree(Gson.java:628)
at com.google.gson.Gson.toJsonTree(Gson.java:607)
at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.serialize(TreeTypeAdapter.java:155)
at org.eclipse.leshan.server.demo.servlet.json.RegistrationSerializer.serialize(RegistrationSerializer.java:52)
at org.eclipse.leshan.server.demo.servlet.json.RegistrationSerializer.serialize(RegistrationSerializer.java:28)
at com.google.gson.internal.bind.TreeTypeAdapter.write(TreeTypeAdapter.java:81)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:127)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:245)
at com.google.gson.Gson.toJson(Gson.java:735)
at com.google.gson.Gson.toJson(Gson.java:714)
at com.google.gson.Gson.toJson(Gson.java:669)
at com.google.gson.Gson.toJson(Gson.java:649)
at org.eclipse.leshan.server.demo.servlet.EventServlet$1.updated(EventServlet.java:94)
at org.eclipse.leshan.server.registration.RegistrationServiceImpl.fireUpdated(RegistrationServiceImpl.java:87)
at org.eclipse.leshan.server.registration.RegistrationHandler$2.run(RegistrationHandler.java:119)
at org.eclipse.leshan.core.response.SendableResponse.sent(SendableResponse.java:47)
at org.eclipse.leshan.server.californium.registration.RegisterResource.handleUpdate(RegisterResource.java:220)
at org.eclipse.leshan.server.californium.registration.RegisterResource.handlePOST(RegisterResource.java:98)
at org.eclipse.californium.core.CoapResource.handleRequest(CoapResource.java:227)
at org.eclipse.leshan.core.californium.LwM2mCoapResource.handleRequest(LwM2mCoapResource.java:51)
at org.eclipse.californium.core.server.ServerMessageDeliverer.deliverRequest(ServerMessageDeliverer.java:106)
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:413)
at org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveRequest(ReliabilityLayer.java:276)
at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:84)
at org.eclipse.californium.core.network.stack.BaseCoapStack.receiveRequest(BaseCoapStack.java:137)
at org.eclipse.californium.core.network.CoapEndpoint$1.receiveRequest(CoapEndpoint.java:309)
at org.eclipse.californium.core.network.UdpMatcher$2.run(UdpMatcher.java:270)
at org.eclipse.californium.elements.util.SerialExecutor$1.run(SerialExecutor.java:289)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)

I compile and run the code at tag 1.3.2. My java version is:

java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

Maven version is:

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: C:\Maven\apache-maven-3.8.4
Java version: 17.0.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-17.0.1
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

My two commands to run the server demo and client demo are:
java -jar leshan-server-demo-1.3.2-jar-with-dependencies.jar
java -jar leshan-client-demo-1.3.2-jar-with-dependencies.jar

For what it's worth, the demo runs fine on my laptop with version v2.x (master branch).

Any help would be appreciated, thank you!

@sbernard31
Copy link
Contributor

This looks like #1099

@sbernard31 sbernard31 added the question Any question about leshan label Jan 10, 2022
@vtran5
Copy link
Author

vtran5 commented Jan 10, 2022

Thank you! It actually is the same issue.

@vtran5 vtran5 closed this as completed Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Any question about leshan
Projects
None yet
Development

No branches or pull requests

2 participants