Thanks, Roland!

This problem can only be recreatble in IBM JVM on some windows vista when
using apache code, J9 works fine. Did not try Sun JVM yet.

Michelle



                                                                       
             Roland Weber                                              
             <[EMAIL PROTECTED]                                         
             com>                                                       To
                                       "HttpClient User Discussion"    
             03/30/2007 12:51          <[email protected]
             AM                        >                               
                                                                        cc
                                                                       
             Please respond to                                     Subject
             "HttpClient User          Re: java.net.BindException on   
                Discussion"            windows vista                   
             <httpclient-user@                                         
             jakarta.apache.or                                         
                    g>                                                 
                                                                       
                                                                       
                                                                       




Hello Michelle,

> Fatal transport error: Address already in use: NET_Bind
> java.net.BindException: Address already in use: NET_Bind
> at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:398)
>
> I also wrote the code use apache client directly and it also causes
> the same exception.
>
> this made me think this may be an apache bug.

Socket opening is not under control of HttpClient. HttpClient
calls a ProtocolSocketFactory, which calls a standard Java API
to open a socket.
Apparently, HttpURLConnection does something differently.
If it is known what the difference is, there is a chance of
adding a workaround to HttpClient, or at least to document
how to work around the problem.

Have you tried to rip out all the HTTP communication and
just perform the socket opening and closing alone? Maybe
with sending some hard-coded request. I'm sure you'll be
able to reproduce this problem without any HttpClient
code being executed.

> The wield thing is we
> can only recreate this problem in some of vista machines, but not
> all vista machines. And it works fine on windows XP. Could this be
> an apache bug?

No, because the HttpClient code seems to work fine on all
other platforms. At most, it is an incompatibility of the
HttpClient code with Vista. In that case, it is up for debate
whether Vista/JVM or HttpClient should be changed. But changing
HttpClient - if we knew what needs to be done - means changing
the behavior on *all* platforms, which is a higher risk.

> if so, what is the process to open an apache bug?

For HttpClient, issues are tracked in JIRA:
http://jakarta.apache.org/commons/httpclient/issue-tracking.html

You can open an issue for tracking purposes. But you should
understand that the developer community of HttpClient is
rather small, and probably does not have the resources to
recreate this problem on Vista. In particular since you
report that it occurs only on *some* of your Vista machines.

FWIW, I think your best chance to get this resolved is to
re-create the problem without HttpClient, just by using plain
old sockets. Then you can report it to Hursely. Btw, are these
problems with the full SUN/IBM JVM, or with J9?

> Also, is there anyway to tune the system settings instead of
> changing the code as you recommended below to solve this problem?

That can only be answered by someone with access to
a Vista system where the problem can be reproduced.

cheers,
  Roland

Reply via email to