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

When BlockwiseLayer is manually turned off, NullPointerException is thrown. #76

Closed
wiinguyen opened this issue Jul 20, 2016 · 3 comments
Assignees

Comments

@wiinguyen
Copy link

When BlockwiseLayer is manually turned off, NullPointerException is thrown.

A proposed quick fix is to check for "response != null" in Matcher.java.

Jul 20, 2016 10:26:19 AM org.eclipse.californium.core.network.CoapEndpoint$5 run
SEVERE: Exception in protocol stage thread: null
java.lang.NullPointerException
at org.eclipse.californium.core.network.Matcher$ExchangeObserverImpl.completed(Matcher.java:535)
at org.eclipse.californium.core.network.Exchange.setComplete(Exchange.java:449)
at org.eclipse.californium.core.network.Matcher.sendResponse(Matcher.java:225)
at org.eclipse.californium.core.network.CoapEndpoint$OutboxImpl.sendResponse(CoapEndpoint.java:530)
at org.eclipse.californium.core.network.stack.CoapStack$StackBottomAdapter.sendResponse(CoapStack.java:217)
at org.eclipse.californium.core.network.stack.AbstractLayer.sendResponse(AbstractLayer.java:71)
at org.eclipse.californium.core.network.stack.ReliabilityLayer.sendResponse(ReliabilityLayer.java:162)
at org.eclipse.californium.core.network.stack.AbstractLayer.sendResponse(AbstractLayer.java:71)
at org.eclipse.californium.core.network.stack.ObserveLayer.sendResponse(ObserveLayer.java:120)
at org.eclipse.californium.core.network.stack.AbstractLayer.sendResponse(AbstractLayer.java:71)
at org.eclipse.californium.core.network.stack.CoapStack$StackTopAdapter.sendResponse(CoapStack.java:176)
at org.eclipse.californium.core.network.stack.CoapStack.sendResponse(CoapStack.java:123)
at org.eclipse.californium.core.network.CoapEndpoint.sendResponse(CoapEndpoint.java:443)
at org.eclipse.californium.core.network.Exchange.sendResponse(Exchange.java:199)
at org.eclipse.californium.core.server.resources.CoapExchange.respond(CoapExchange.java:290)
at org.eclipse.californium.core.server.resources.CoapExchange.respond(CoapExchange.java:211)
at org.eclipse.californium.core.server.resources.CoapExchange.respond(CoapExchange.java:192)
at org.eclipse.californium.examples.HelloWorldServer$HelloWorldResource.handlePOST(HelloWorldServer.java:152)
at org.eclipse.californium.core.CoapResource.handleRequest(CoapResource.java:217)
at org.eclipse.californium.core.server.ServerMessageDeliverer.deliverRequest(ServerMessageDeliverer.java:86)
at org.eclipse.californium.core.network.stack.CoapStack$StackTopAdapter.receiveRequest(CoapStack.java:185)
at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:91)
at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:91)
at
org.eclipse.californium.core.network.stack.ReliabilityLayer.receiveRequest(ReliabilityLayer.java:236)
at org.eclipse.californium.core.network.stack.AbstractLayer.receiveRequest(AbstractLayer.java:91)
at org.eclipse.californium.core.network.stack.CoapStack.receiveRequest(CoapStack.java:133)
at org.eclipse.californium.core.network.CoapEndpoint$InboxImpl.receiveMessage(CoapEndpoint.java:654)
at org.eclipse.californium.core.network.CoapEndpoint$InboxImpl.access$700(CoapEndpoint.java:583)
at org.eclipse.californium.core.network.CoapEndpoint$InboxImpl$1.run(CoapEndpoint.java:597)
at org.eclipse.californium.core.network.CoapEndpoint$5.run(CoapEndpoint.java:746)
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)

cf-coap-blockwise-bug.txt

@sophokles73
Copy link
Contributor

Hi @wiinguyen,

I am not really sure about the intent of your issue report. Are you asking for help regarding how to disable blockwise support? I am asking because this is not a configurable option in Californium (yet).
May I also ask why you want to disable the blockwise layer in the first place?

@sophokles73 sophokles73 self-assigned this Jul 21, 2016
@wiinguyen
Copy link
Author

Hi Kai,

Please see inline.

On Jul 21, 2016, at 9:40 AM, Kai Hudalla notifications@github.com wrote:

Hi @wiinguyen,

I am not really sure about the intent of your issue report. Are you asking for help regarding how to disable blockwise support?

Yes, I'm integrating a reliable transport solution which has its own alternative blockwise protocol. Thus, blockwise is not needed in this case.

I'm not convinced that the blockwise would be needed either for CoAP+TCP <--> CoAP+TCP. This needs to be evaluated.

I am asking because this is not a configurable option in Californium (yet).
May I also ask why you want to disable the blockwise layer in the first place?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@sophokles73
Copy link
Contributor

Well, even with using TCP as the transport, using blockwise has some advantages, e.g. when transferring larger payloads using blockwise you are not blocking the transport channel for the entire transfer time because the transfer is done in smaller chunks leaving room for other messages being multiplexed into the stream.
Support for disabling blockwise should best be done by introducing a configuration option, I guess. Much along the lines of the way the reliability layer can be configured to support congestion control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants