You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Isaac Cruz Ballesteros (Created) (JIRA)" <ji...@apache.org> on 2011/11/25 12:14:40 UTC

[jira] [Created] (HTTPCORE-283) Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest

Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest
------------------------------------------------------------------------------------------------------------------

                 Key: HTTPCORE-283
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-283
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore NIO
    Affects Versions: 4.1.3
            Reporter: Isaac Cruz Ballesteros
         Attachments: NHttpServer.java

I want to implement a completely asynchronous server, I've used the NHttpServer example but changing the handler to AsyncNHttpServiceHandler.

When throwing this exception from entityRequest():

        public ConsumingNHttpEntity entityRequest(HttpEntityEnclosingRequest request, HttpContext context)
                throws HttpException, IOException {
            throw new MethodNotSupportedException("method not supported");
        }

the DefaultListeningIOReactor shutdowns throwing the following exception:

org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:321)
	at NHttpServer.main(NHttpServer.java:67)
Caused by: java.lang.NullPointerException
	at org.apache.http.nio.protocol.AsyncNHttpServiceHandler.inputReady(AsyncNHttpServiceHandler.java:313)
	at org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:175)
	at org.apache.http.impl.nio.DefaultServerIOEventDispatch.inputReady(DefaultServerIOEventDispatch.java:154)
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:158)
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:340)
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:318)
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
	at java.lang.Thread.run(Thread.java:619)

I'm attaching the example to test the error

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Resolved] (HTTPCORE-283) Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest

Posted by "Oleg Kalnichevski (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCORE-283.
----------------------------------------

    Resolution: Fixed

This one turned out to be a rather nasty bug. I applied a workaround preventing the i/o reactor from terminating in case of an exception thrown in the #entityRequest method. However, the handler still drops the connection instead of sending a 501 or 500 status to the client, as expected. A proper fix has been applied to the trunk (4.2).

Oleg
                
> Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-283
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-283
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.1.3
>            Reporter: Isaac Cruz Ballesteros
>             Fix For: 4.1.4, 4.2-alpha3
>
>         Attachments: NHttpServer.java
>
>
> I want to implement a completely asynchronous server, I've used the NHttpServer example but changing the handler to AsyncNHttpServiceHandler.
> When throwing this exception from entityRequest():
>         public ConsumingNHttpEntity entityRequest(HttpEntityEnclosingRequest request, HttpContext context)
>                 throws HttpException, IOException {
>             throw new MethodNotSupportedException("method not supported");
>         }
> the DefaultListeningIOReactor shutdowns throwing the following exception:
> org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:321)
> 	at NHttpServer.main(NHttpServer.java:67)
> Caused by: java.lang.NullPointerException
> 	at org.apache.http.nio.protocol.AsyncNHttpServiceHandler.inputReady(AsyncNHttpServiceHandler.java:313)
> 	at org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:175)
> 	at org.apache.http.impl.nio.DefaultServerIOEventDispatch.inputReady(DefaultServerIOEventDispatch.java:154)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:158)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:340)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:318)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
> 	at java.lang.Thread.run(Thread.java:619)
> I'm attaching the example to test the error

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCORE-283) Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest

Posted by "Isaac Cruz Ballesteros (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Isaac Cruz Ballesteros updated HTTPCORE-283:
--------------------------------------------

    Attachment: NHttpServer.java
    
> Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-283
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-283
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.1.3
>            Reporter: Isaac Cruz Ballesteros
>         Attachments: NHttpServer.java
>
>
> I want to implement a completely asynchronous server, I've used the NHttpServer example but changing the handler to AsyncNHttpServiceHandler.
> When throwing this exception from entityRequest():
>         public ConsumingNHttpEntity entityRequest(HttpEntityEnclosingRequest request, HttpContext context)
>                 throws HttpException, IOException {
>             throw new MethodNotSupportedException("method not supported");
>         }
> the DefaultListeningIOReactor shutdowns throwing the following exception:
> org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:321)
> 	at NHttpServer.main(NHttpServer.java:67)
> Caused by: java.lang.NullPointerException
> 	at org.apache.http.nio.protocol.AsyncNHttpServiceHandler.inputReady(AsyncNHttpServiceHandler.java:313)
> 	at org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:175)
> 	at org.apache.http.impl.nio.DefaultServerIOEventDispatch.inputReady(DefaultServerIOEventDispatch.java:154)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:158)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:340)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:318)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
> 	at java.lang.Thread.run(Thread.java:619)
> I'm attaching the example to test the error

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCORE-283) Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest

Posted by "Isaac Cruz Ballesteros (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157100#comment-13157100 ] 

Isaac Cruz Ballesteros commented on HTTPCORE-283:
-------------------------------------------------

Sorry, the exception is thrown when trying to upload a file, for example with this command:

curl.exe -v -X PUT -T <anyfile> http://localhost:8080/
                
> Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-283
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-283
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.1.3
>            Reporter: Isaac Cruz Ballesteros
>         Attachments: NHttpServer.java
>
>
> I want to implement a completely asynchronous server, I've used the NHttpServer example but changing the handler to AsyncNHttpServiceHandler.
> When throwing this exception from entityRequest():
>         public ConsumingNHttpEntity entityRequest(HttpEntityEnclosingRequest request, HttpContext context)
>                 throws HttpException, IOException {
>             throw new MethodNotSupportedException("method not supported");
>         }
> the DefaultListeningIOReactor shutdowns throwing the following exception:
> org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:321)
> 	at NHttpServer.main(NHttpServer.java:67)
> Caused by: java.lang.NullPointerException
> 	at org.apache.http.nio.protocol.AsyncNHttpServiceHandler.inputReady(AsyncNHttpServiceHandler.java:313)
> 	at org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:175)
> 	at org.apache.http.impl.nio.DefaultServerIOEventDispatch.inputReady(DefaultServerIOEventDispatch.java:154)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:158)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:340)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:318)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
> 	at java.lang.Thread.run(Thread.java:619)
> I'm attaching the example to test the error

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCORE-283) Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest

Posted by "Oleg Kalnichevski (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCORE-283:
---------------------------------------

    Fix Version/s: 4.2-alpha3
                   4.1.4
    
> Async server: NPE in AsyncNHttpServiceHandler when throwing a HttpException from NHttpRequestHandler.entityRequest
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-283
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-283
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.1.3
>            Reporter: Isaac Cruz Ballesteros
>             Fix For: 4.1.4, 4.2-alpha3
>
>         Attachments: NHttpServer.java
>
>
> I want to implement a completely asynchronous server, I've used the NHttpServer example but changing the handler to AsyncNHttpServiceHandler.
> When throwing this exception from entityRequest():
>         public ConsumingNHttpEntity entityRequest(HttpEntityEnclosingRequest request, HttpContext context)
>                 throws HttpException, IOException {
>             throw new MethodNotSupportedException("method not supported");
>         }
> the DefaultListeningIOReactor shutdowns throwing the following exception:
> org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:321)
> 	at NHttpServer.main(NHttpServer.java:67)
> Caused by: java.lang.NullPointerException
> 	at org.apache.http.nio.protocol.AsyncNHttpServiceHandler.inputReady(AsyncNHttpServiceHandler.java:313)
> 	at org.apache.http.impl.nio.DefaultNHttpServerConnection.consumeInput(DefaultNHttpServerConnection.java:175)
> 	at org.apache.http.impl.nio.DefaultServerIOEventDispatch.inputReady(DefaultServerIOEventDispatch.java:154)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:158)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:340)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:318)
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
> 	at java.lang.Thread.run(Thread.java:619)
> I'm attaching the example to test the error

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org