axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Felarca <>
Subject Axis 1.4 - CommonsHTTPSender and proxy protocol problem
Date Wed, 20 Feb 2008 18:49:28 GMT
Hello all,

This is with Axis 1.4 and commons-httpclient 3.0.1

I have an axis client, deployed via webstart, which has been fine in the past with picking
up its proxy settings from the browser and communicating correctly.

Recently, I ran into a deployment at a customer site where the communication was failing with
a NullPointerException coming out of ...axis.transport.http.CommonsHTTPSender.invoke.

I put some simple prints into the source around that area and rebuilt the axis jar to try
and get a bit more information. I have included a snip of the logs below and a section of
the code I modified as well, however the end result is that while it is reading the proxy
host correctly, for some reason there ends up being no protocol. This is an issue because
the code expects there to be one set.

I also placed prints in the getHostConfiguration method, which is called before the failure,
and it appears from that block of code that in the case where a proxy is set, the host and
port do not get set on the HostConfiguration object. This would be why the null pointer ends
up throwing an exception when the axis CommonsHTTPSender attempts to test if the protocol
is secure.

Has anyone seen an issue like this before? Is there something I am doing wrong fundamentally,
or something incorrect about the data that is being passed in? Any thoughts or ideas would
be greatly appreciated.

Thanks in advance,


Log snip:

AXIS-MMF targetURL is https://mywebserviceurl
AXIS-MMF port is -1
AXIS-MMF hostInNonProxyList is false
AXIS-MMF hostConfiguration is HostConfiguration[proxyHost=http://proxy.customer]
AXIS-MMF hostConfiguration protocol is null
 faultCode: {}Server.userException
 faultString: java.lang.NullPointerException
    at org.apache.axis.transport.http.CommonsHTTPSender.invoke(
    at org.apache.axis.strategies.InvocationStrategy.visit(
    at org.apache.axis.SimpleChain.doVisiting(
    at org.apache.axis.SimpleChain.invoke(
    at org.apache.axis.client.AxisClient.invoke(
    at org.apache.axis.client.Call.invokeEngine(
    at org.apache.axis.client.Call.invoke(

Code snip: Lines 185 to 197 --- 193 is the hostConfiguration.getProtocol().isSecure() line.

            if (msgContext.getMaintainSession()) {
                HttpState state = httpClient.getState();
                String host = hostConfiguration.getHost();
                String path = targetURL.getPath();
                System.out.println("AXIS-MMF hostConfiguration is "+hostConfiguration);
                System.out.println("AXIS-MMF hostConfiguration protocol is "+hostConfiguration.getProtocol());
                boolean secure = hostConfiguration.getProtocol().isSecure();
                fillHeaders(msgContext, state, HTTPConstants.HEADER_COOKIE, host, path, secure);
                fillHeaders(msgContext, state, HTTPConstants.HEADER_COOKIE2, host, path, secure);

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message