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 ji...@apache.org on 2004/05/11 14:50:22 UTC

[jira] Created: (AXIS-1356) CommonsHTTPSender NPE when proxy is set

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1356

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1356
    Summary: CommonsHTTPSender NPE when proxy is set
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
 Components: 
             Basic Architecture
   Versions:
             current (nightly)

   Assignee: 
   Reporter: Dominik Westner

    Created: Tue, 11 May 2004 3:52 AM
    Updated: Tue, 11 May 2004 3:52 AM
Environment: Mac OS X 10.3.3, java full version "1.4.2_03-117.1", Nightly Build ws-axis_20040505104443

Description:
When a proxy is set there is a NPE in CommonsHTTPSender:
        {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
        at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:145)
        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:144)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2712)
        at org.apache.axis.client.Call.invoke(Call.java:2695)
        at org.apache.axis.client.Call.invoke(Call.java:2378)
        at org.apache.axis.client.Call.invoke(Call.java:2301)
        at org.apache.axis.client.Call.invoke(Call.java:1762)

I think this is due to the fact that there is not Host set for HTTPHostConfiguration.
Here is a patch which works for me:

--- ws-axis/java/src/org/apache/axis/transport/http/CommonsHTTPSender.java     Fri Mar 12 12:34:24 2004
+++ ws-axis-dw/java/src/org/apache/axis/transport/http/CommonsHTTPSender.java  Tue May 11 11:40:10 2004
              
@@ -278,11 +300,10 @@
         if (port == -1) {
             port = 80;          // even for https
         }
-        if (tcp.getProxyHost().length() == 0 ||
-        tcp.getProxyPort().length() == 0 ||
-        hostInNonProxyList) {
-            config.setHost(targetURL.getHost(), port, targetURL.getProtocol());
-        } else {
+               config.setHost(targetURL.getHost(), port, targetURL.getProtocol());
+        if (tcp.getProxyHost().length() > 0 &&
+        tcp.getProxyPort().length() > 0 &&
+        !hostInNonProxyList) {
             if (tcp.getProxyUser().length() != 0) {
                 Credentials proxyCred =
                 new UsernamePasswordCredentials(tcp.getProxyUser(),


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (AXIS-1356) CommonsHTTPSender NPE when proxy is set

Posted by ji...@apache.org.
Message:

   The following issue has been closed.

   Resolver: Davanum Srinivas
       Date: Tue, 11 May 2004 6:42 AM

Applied Patch.

thanks,
dims
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1356

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1356
    Summary: CommonsHTTPSender NPE when proxy is set
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: Axis
 Components: 
             Basic Architecture
   Versions:
             current (nightly)

   Assignee: 
   Reporter: Dominik Westner

    Created: Tue, 11 May 2004 3:52 AM
    Updated: Tue, 11 May 2004 6:42 AM
Environment: Mac OS X 10.3.3, java full version "1.4.2_03-117.1", Nightly Build ws-axis_20040505104443

Description:
When a proxy is set there is a NPE in CommonsHTTPSender:
        {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
        at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:145)
        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:144)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2712)
        at org.apache.axis.client.Call.invoke(Call.java:2695)
        at org.apache.axis.client.Call.invoke(Call.java:2378)
        at org.apache.axis.client.Call.invoke(Call.java:2301)
        at org.apache.axis.client.Call.invoke(Call.java:1762)

I think this is due to the fact that there is not Host set for HTTPHostConfiguration.
Here is a patch which works for me:

--- ws-axis/java/src/org/apache/axis/transport/http/CommonsHTTPSender.java     Fri Mar 12 12:34:24 2004
+++ ws-axis-dw/java/src/org/apache/axis/transport/http/CommonsHTTPSender.java  Tue May 11 11:40:10 2004
              
@@ -278,11 +300,10 @@
         if (port == -1) {
             port = 80;          // even for https
         }
-        if (tcp.getProxyHost().length() == 0 ||
-        tcp.getProxyPort().length() == 0 ||
-        hostInNonProxyList) {
-            config.setHost(targetURL.getHost(), port, targetURL.getProtocol());
-        } else {
+               config.setHost(targetURL.getHost(), port, targetURL.getProtocol());
+        if (tcp.getProxyHost().length() > 0 &&
+        tcp.getProxyPort().length() > 0 &&
+        !hostInNonProxyList) {
             if (tcp.getProxyUser().length() != 0) {
                 Credentials proxyCred =
                 new UsernamePasswordCredentials(tcp.getProxyUser(),


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira