You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Dzung Tran (JIRA)" <ji...@apache.org> on 2010/10/07 20:09:32 UTC

[jira] Closed: (AXIS2-4823) Error "Address is invalid on local machine..." occurs when http.proxyHost is "" (blank) instead of null.

     [ https://issues.apache.org/jira/browse/AXIS2-4823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dzung Tran closed AXIS2-4823.
-----------------------------

    Resolution: Not A Problem

This was due to another software that was setting the proxy variables incorrectly, which affected all threads in the connection. 

> Error "Address is invalid on local machine..." occurs when http.proxyHost is "" (blank) instead of null.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-4823
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4823
>             Project: Axis2
>          Issue Type: Bug
>          Components: transports
>    Affects Versions: 1.5
>         Environment: Windows Sever 2003
>            Reporter: Dzung Tran
>
> We generate a proxy client using wsdl2Java. We do not have any proxy server enabled in our system. However, after the system is in use for some time (a few hours), something sets the system variable http.proxyHost to "" (blank) instead of null. That is, the call to System.getProperty(HTTP_PROXY_HOST) returns "" instead of null. We have yet to figure out why this happens. 
> That causes the following if block in org.apache.axis2.transport.http.AbstractHTTPSender to evaluate to true and execute, 
>         // proxy configuration
>         if (ProxyConfiguration.isProxyEnabled(msgCtx,targetURL)) {
>             log.debug("ProxyConfiguration");
>             ProxyConfiguration proxyConfiguration = new ProxyConfiguration();
>             proxyConfiguration.configure(msgCtx,client,config);
>         }
> Because of this, the program thinks a proxy connection with proxy host = "" is enabled and it tries to use it. See below (org.apache.commons.httpclient.HttpConnection)
>     public void open() throws IOException {
>         LOG.trace("enter HttpConnection.open()");
>         final String host = (proxyHostName == null) ? hostName : proxyHostName;
>         final int port = (proxyHostName == null) ? portNumber : proxyPortNumber;
>         assertNotOpen();
> And because the host is "', we get the error "Address is invalid on local machine, or port is not valid on remote machine". 
> This prevents all transactions from being sent to the server, and requires a restart of our services. 
> Question:
> What is setting the http.proxyHost to blank? 
> Should blank http.proxyHost be treated the same way as null? (If blanks were treated like nulls in this case, we wouldn't have this issue.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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