Noticed this & am modifying DefaultNHttpClientConnection.submitRequest
-- it checks for request being an instanceof
HttpEntityEnclosingRequest, not also for if the enclosed entity is
non-null.  (Also am making a few changes to the flow for submitting,
to make sure it's submitted only after the right entity is set by the
Async handler.)

Sam

On 3/7/08, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
>
> On Fri, 2008-03-07 at 23:34 +0100, Oleg Kalnichevski wrote:
> > On Fri, 2008-03-07 at 16:18 -0500, Sam Berlin wrote:
> > > Ya, that's basically the reason for the suggestion -- to prevent
> > > adding a bunch of if!=null checks all over.  Good to know that the
> > > Async client handler is being used (if only indirectly) !
> > >
> > > Sam
> > >
> >
> > Sam, Andreas
> >
> > Null checks are cheaper, and I do not think there are going to be that
> > many of those. Sam, would it be a big deal for you to put together a
> > patch?
> >
> > Oleg
> >
>
> Wait a sec! If there is no request entity
> AsyncNHttpClientHandler#outputReady is not even supposed to fire.
> Something is wrong. I think we need a test case to reproduce the
> problem.
>
> Oleg
>
> >
> >
> > > On 3/7/08, Andreas Andreou <[EMAIL PROTECTED]> wrote:
> > > > i'm totally clueless on the internals but this suggestion sounds like
> > > > the null-object pattern and indeed makes sense here (instead of keep 
> > > > finding
> > > > probable null checking situations)
> > > >
> > > > On Fri, Mar 7, 2008 at 11:12 PM, Sam Berlin <[EMAIL PROTECTED]> wrote:
> > > > > I think the change should be to set an empty entity if none is set but
> > > > >  the request is an entity-enclosing one, rather not setting one at 
> > > > > all.
> > > > >
> > > > >  Sam
> > > > >
> > > > >
> > > > >
> > > > >  On 3/7/08, Andreas Andreou <[EMAIL PROTECTED]> wrote:
> > > > >  > hmmm - no luck... I now get
> > > > >  >
> > > > >  > Exception in thread "IO Reactor Execution Thread" 
> > > > > java.lang.NullPointerException
> > > > >  >        at 
> > > > > org.apache.http.nio.protocol.AsyncNHttpClientHandler.outputReady(AsyncNHttpClientHandler.java:222)
> > > > >  >        at 
> > > > > org.apache.http.nio.protocol.BufferingHttpClientHandler.outputReady(BufferingHttpClientHandler.java:110)
> > > > >  >        at 
> > > > > org.apache.http.impl.nio.DefaultNHttpClientConnection.produceOutput(DefaultNHttpClientConnection.java:170)
> > > > >  >        at 
> > > > > org.apache.http.impl.nio.DefaultClientIOEventDispatch.outputReady(DefaultClientIOEventDispatch.java:105)
> > > > >  >
> > > > >  > so (unless the above makes sense for you) perhaps i should try and 
> > > > > get
> > > > >  > you a testcase...
> > > > >  >
> > > > >  > On Fri, Mar 7, 2008 at 10:18 PM, Oleg Kalnichevski <[EMAIL 
> > > > > PROTECTED]> wrote:
> > > > >  > >
> > > > >  > >  On Fri, 2008-03-07 at 00:56 +0200, Andreas Andreou wrote:
> > > > >  > >
> > > > >  > >
> > > > >  > > > Hi list!
> > > > >  > >  > We've been using httpcore & httpcore-nio
> > > > >  > >  > 4.0-beta2-20080229.095821-3 but since the new
> > > > >  > >  > 4.0-beta2-20080303.182830-4 we've been getting (on attempts 
> > > > > to request any url)
> > > > >  > >  > Exception in thread "IO Reactor Execution Thread"
> > > > >  > >  > java.lang.IllegalArgumentException: wrapped entity must not 
> > > > > be null
> > > > >  > >  >         at 
> > > > > org.apache.http.entity.HttpEntityWrapper.<init>(HttpEntityWrapper.java:66)
> > > > >  > >  >         at 
> > > > > org.apache.http.nio.entity.NHttpEntityWrapper.<init>(NHttpEntityWrapper.java:53)
> > > > >  > >  >         at 
> > > > > org.apache.http.nio.protocol.AsyncNHttpClientHandler.requestReady(AsyncNHttpClientHandler.java:156)
> > > > >  > >  >         at 
> > > > > org.apache.http.nio.protocol.AsyncNHttpClientHandler.connected(AsyncNHttpClientHandler.java:109)
> > > > >  > >  >         at 
> > > > > org.apache.http.nio.protocol.BufferingHttpClientHandler.connected(BufferingHttpClientHandler.java:94)
> > > > >  > >  >         at 
> > > > > org.apache.http.impl.nio.DefaultClientIOEventDispatch.connected(DefaultClientIOEventDispatch.java:87)
> > > > >  > >  >         at 
> > > > > com.amplafi.core.iomanagement.http.UniversalIOEventDispatch.connected(UniversalIOEventDispatch.java:102)
> > > > >  > >  >         at 
> > > > > $IOEventDispatch_1187ff96e6e.connected($IOEventDispatch_1187ff96e6e.java)
> > > > >  > >  >         at 
> > > > > $IOEventDispatch_1187ff96e6d.connected($IOEventDispatch_1187ff96e6d.java)
> > > > >  > >  >         at 
> > > > > org.apache.http.impl.nio.reactor.BaseIOReactor.keyCreated(BaseIOReactor.java:182)
> > > > >  > >  >         at 
> > > > > org.apache.http.impl.nio.reactor.AbstractIOReactor.processNewChannels(AbstractIOReactor.java:246)
> > > > >  > >  >         at 
> > > > > org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:153)
> > > > >  > >  >         at 
> > > > > org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:70)
> > > > >  > >  >         at 
> > > > > org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:318)
> > > > >  > >  >         at java.lang.Thread.run(Thread.java:619)
> > > > >  > >  >
> > > > >  > >  > Does this ring any bells? I've seen a few commits, on 1/3 and 
> > > > > 2/3, so
> > > > >  > >  > i'm wondering if there's something important
> > > > >  > >  > on those changes.
> > > > >  > >  >
> > > > >  > >
> > > > >  > >  Andreas,
> > > > >  > >
> > > > >  > >  I believe I have fixed the problem in trunk and published the 
> > > > > latest
> > > > >  > >  snapshots to the repository. Could you please re-test?
> > > > >  > >
> > > > >  > >
> > > > >  > >
> > > > >  > >  Cheers,
> > > > >  > >
> > > > >  > >  Oleg
> > > > >  > >
> > > > >  > >  > TIA
> > > > >  > >
> > > > >  > >
> > > > >  > >  
> > > > > ---------------------------------------------------------------------
> > > > >  > >  To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > >  > >  For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >  > >
> > > > >  > >
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > --
> > > > >  > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > > >  > Tapestry / Tacos developer
> > > > >  > Open Source / JEE Consulting
> > > > >  >
> > > > >  > 
> > > > > ---------------------------------------------------------------------
> > > > >  > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > >  > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >  >
> > > > >  >
> > > > >
> > > > >  ---------------------------------------------------------------------
> > > > >  To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > >  For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > > Tapestry / Tacos developer
> > > > Open Source / JEE Consulting
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to