axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Felarca <gennad...@yahoo.com>
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,

Mario-

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
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.NullPointerException
 faultActor: 
 faultNode: 
 faultDetail: 
    {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
    at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:193)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)

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

            if (msgContext.getMaintainSession()) {
                HttpState state = httpClient.getState();
                method.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
                String host = hostConfiguration.getHost();
                String path = targetURL.getPath();
                //MMF
                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);
                httpClient.setState(state);
            }





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


Mime
View raw message