You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Ga...@tdwh.co.uk on 2004/03/08 16:33:13 UTC

small fix to HttpConnection




I've come across a minor problem with the ConnectionTimeoutException.

The exception isn't serializable because it is declared as an non static
inner class to HttpConnection, which in turn has references to all maner of
goodies.

It becomes a problem when http client is used in a J2EE application and the
Exception gets thrown as a root cause out of an EJB.


FIX:
    // -- Timeout Exception
    /**
     * Signals that a timeout occured while opening the socket.
     */
    public static class ConnectionTimeoutException extends IOException {
        /** Create an instance */
        public ConnectionTimeoutException() {
        }
    }

Garet Davis
Confidentiality:  This email and its attachments are intended for the above
named only and may be confidential.  If they have come to you in error you
must take no action based on them, nor must you copy or show them to
anyone; please reply to this email and highlight the error.

Viruses:  Although we have taken steps to ensure that this email and
attachments are free from any virus, we advise that in keeping with good
computing practice the recipient should ensure that they are actually
virus-free.

Brokerage services provided by TD Waterhouse Investor Services (Europe)
Limited (a subsidiary of The Toronto-Dominion Bank).  Authorised and
regulated by the Financial Services Authority (FSA registered number
141282), member of the London Stock Exchange and OFEX. Incorporated in
England and Wales under registration number 2101863.  Registered office:
Exchange Court, Duncombe Street, Leeds LS1 4AX.   Banking services provided
by TD Waterhouse Bank N.V. authorised and regulated by De Nederlandsche
Bank and the Financial Services Authority for UK Business (FSA registered
number 216791).  Incorporated in the Netherlands and registered as a branch
in England and Wales under branch registration number BR006780.


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


Re: small fix to HttpConnection

Posted by Oleg Kalnichevski <ol...@apache.org>.
ConnectionTimeoutException inner class of the HttpConnection class made
static in the 2.0 branch

Oleg


On Tue, 2004-03-09 at 01:30, Michael Becke wrote:
> Static works for me.
> 
> Mike
> 
> On Mar 8, 2004, at 4:03 PM, Oleg Kalnichevski wrote:
> 
> > Gareth,
> > In the development version of HttpClient (which will eventually become
> > 3.0) ConnectionTimeoutException is no longer an inner class of
> > HttpConnection.
> >
> > Folks, do you see any reasons for not making ConnectionTimeoutException
> > static in the 2.0 branch?
> >
> > Oleg
> >
> >
> > On Mon, 2004-03-08 at 16:33, Gareth_Davies@tdwh.co.uk wrote:
> >>
> >>
> >> I've come across a minor problem with the ConnectionTimeoutException.
> >>
> >> The exception isn't serializable because it is declared as an non 
> >> static
> >> inner class to HttpConnection, which in turn has references to all 
> >> maner of
> >> goodies.
> >>
> >> It becomes a problem when http client is used in a J2EE application 
> >> and the
> >> Exception gets thrown as a root cause out of an EJB.
> >>
> >>
> >> FIX:
> >>     // -- Timeout Exception
> >>     /**
> >>      * Signals that a timeout occured while opening the socket.
> >>      */
> >>     public static class ConnectionTimeoutException extends 
> >> IOException {
> >>         /** Create an instance */
> >>         public ConnectionTimeoutException() {
> >>         }
> >>     }
> >>
> >> Garet Davis
> >> Confidentiality:  This email and its attachments are intended for the 
> >> above
> >> named only and may be confidential.  If they have come to you in 
> >> error you
> >> must take no action based on them, nor must you copy or show them to
> >> anyone; please reply to this email and highlight the error.
> >>
> >> Viruses:  Although we have taken steps to ensure that this email and
> >> attachments are free from any virus, we advise that in keeping with 
> >> good
> >> computing practice the recipient should ensure that they are actually
> >> virus-free.
> >>
> >> Brokerage services provided by TD Waterhouse Investor Services 
> >> (Europe)
> >> Limited (a subsidiary of The Toronto-Dominion Bank).  Authorised and
> >> regulated by the Financial Services Authority (FSA registered number
> >> 141282), member of the London Stock Exchange and OFEX. Incorporated in
> >> England and Wales under registration number 2101863.  Registered 
> >> office:
> >> Exchange Court, Duncombe Street, Leeds LS1 4AX.   Banking services 
> >> provided
> >> by TD Waterhouse Bank N.V. authorised and regulated by De 
> >> Nederlandsche
> >> Bank and the Financial Services Authority for UK Business (FSA 
> >> registered
> >> number 216791).  Incorporated in the Netherlands and registered as a 
> >> branch
> >> in England and Wales under branch registration number BR006780.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: 
> >> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: 
> >> commons-httpclient-dev-help@jakarta.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: 
> > commons-httpclient-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> > commons-httpclient-dev-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> 


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


Re: small fix to HttpConnection

Posted by Michael Becke <be...@u.washington.edu>.
Static works for me.

Mike

On Mar 8, 2004, at 4:03 PM, Oleg Kalnichevski wrote:

> Gareth,
> In the development version of HttpClient (which will eventually become
> 3.0) ConnectionTimeoutException is no longer an inner class of
> HttpConnection.
>
> Folks, do you see any reasons for not making ConnectionTimeoutException
> static in the 2.0 branch?
>
> Oleg
>
>
> On Mon, 2004-03-08 at 16:33, Gareth_Davies@tdwh.co.uk wrote:
>>
>>
>> I've come across a minor problem with the ConnectionTimeoutException.
>>
>> The exception isn't serializable because it is declared as an non 
>> static
>> inner class to HttpConnection, which in turn has references to all 
>> maner of
>> goodies.
>>
>> It becomes a problem when http client is used in a J2EE application 
>> and the
>> Exception gets thrown as a root cause out of an EJB.
>>
>>
>> FIX:
>>     // -- Timeout Exception
>>     /**
>>      * Signals that a timeout occured while opening the socket.
>>      */
>>     public static class ConnectionTimeoutException extends 
>> IOException {
>>         /** Create an instance */
>>         public ConnectionTimeoutException() {
>>         }
>>     }
>>
>> Garet Davis
>> Confidentiality:  This email and its attachments are intended for the 
>> above
>> named only and may be confidential.  If they have come to you in 
>> error you
>> must take no action based on them, nor must you copy or show them to
>> anyone; please reply to this email and highlight the error.
>>
>> Viruses:  Although we have taken steps to ensure that this email and
>> attachments are free from any virus, we advise that in keeping with 
>> good
>> computing practice the recipient should ensure that they are actually
>> virus-free.
>>
>> Brokerage services provided by TD Waterhouse Investor Services 
>> (Europe)
>> Limited (a subsidiary of The Toronto-Dominion Bank).  Authorised and
>> regulated by the Financial Services Authority (FSA registered number
>> 141282), member of the London Stock Exchange and OFEX. Incorporated in
>> England and Wales under registration number 2101863.  Registered 
>> office:
>> Exchange Court, Duncombe Street, Leeds LS1 4AX.   Banking services 
>> provided
>> by TD Waterhouse Bank N.V. authorised and regulated by De 
>> Nederlandsche
>> Bank and the Financial Services Authority for UK Business (FSA 
>> registered
>> number 216791).  Incorporated in the Netherlands and registered as a 
>> branch
>> in England and Wales under branch registration number BR006780.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: 
>> commons-httpclient-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> commons-httpclient-dev-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> commons-httpclient-dev-help@jakarta.apache.org
>


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


Re: small fix to HttpConnection

Posted by Oleg Kalnichevski <ol...@apache.org>.
Gareth,
In the development version of HttpClient (which will eventually become
3.0) ConnectionTimeoutException is no longer an inner class of
HttpConnection. 

Folks, do you see any reasons for not making ConnectionTimeoutException
static in the 2.0 branch?

Oleg


On Mon, 2004-03-08 at 16:33, Gareth_Davies@tdwh.co.uk wrote:
> 
> 
> I've come across a minor problem with the ConnectionTimeoutException.
> 
> The exception isn't serializable because it is declared as an non static
> inner class to HttpConnection, which in turn has references to all maner of
> goodies.
> 
> It becomes a problem when http client is used in a J2EE application and the
> Exception gets thrown as a root cause out of an EJB.
> 
> 
> FIX:
>     // -- Timeout Exception
>     /**
>      * Signals that a timeout occured while opening the socket.
>      */
>     public static class ConnectionTimeoutException extends IOException {
>         /** Create an instance */
>         public ConnectionTimeoutException() {
>         }
>     }
> 
> Garet Davis
> Confidentiality:  This email and its attachments are intended for the above
> named only and may be confidential.  If they have come to you in error you
> must take no action based on them, nor must you copy or show them to
> anyone; please reply to this email and highlight the error.
> 
> Viruses:  Although we have taken steps to ensure that this email and
> attachments are free from any virus, we advise that in keeping with good
> computing practice the recipient should ensure that they are actually
> virus-free.
> 
> Brokerage services provided by TD Waterhouse Investor Services (Europe)
> Limited (a subsidiary of The Toronto-Dominion Bank).  Authorised and
> regulated by the Financial Services Authority (FSA registered number
> 141282), member of the London Stock Exchange and OFEX. Incorporated in
> England and Wales under registration number 2101863.  Registered office:
> Exchange Court, Duncombe Street, Leeds LS1 4AX.   Banking services provided
> by TD Waterhouse Bank N.V. authorised and regulated by De Nederlandsche
> Bank and the Financial Services Authority for UK Business (FSA registered
> number 216791).  Incorporated in the Netherlands and registered as a branch
> in England and Wales under branch registration number BR006780.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> 


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