You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Fredrik Wendt (JIRA)" <ji...@apache.org> on 2011/04/29 17:13:03 UTC

[jira] [Created] (XMLRPC-186) NullPointerException thrown for illegal port numbers

NullPointerException thrown for illegal port numbers
----------------------------------------------------

                 Key: XMLRPC-186
                 URL: https://issues.apache.org/jira/browse/XMLRPC-186
             Project: XML-RPC
          Issue Type: Bug
          Components: Source
    Affects Versions: 3.1.3
            Reporter: Fredrik Wendt
            Priority: Minor


When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a {{NullPointerException}}. After debugging I see that the constructor call to {{java.net.InetSocketAddress}} throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from {{ReflectionSocketFactory}}.
I suggest adding:
{{if (cause instanceof IllegalArgumentException) {
  throw (IllegalArgumentException) cause;
}
}}
to give users of XmlRpcClient better error messages.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (XMLRPC-186) NullPointerException thrown for illegal port numbers

Posted by "Fredrik Wendt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/XMLRPC-186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fredrik Wendt updated XMLRPC-186:
---------------------------------

    Attachment: ControllerThreadSocketFactoryTest.java

To me, this looks like the ControllerThreadSocketFactory.createSocket(...) method ignores IllegalArgumentExceptions and silently returns null after the timeout has elapsed, which breaks the ProtocolSocketFactory contract.
(The httpclient.HttpConnection.open() method in turns expectes that a socket factory always returns a socket, which then causes the NullPointerException.)

> NullPointerException thrown for illegal port numbers
> ----------------------------------------------------
>
>                 Key: XMLRPC-186
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-186
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 3.1.3
>            Reporter: Fredrik Wendt
>            Priority: Minor
>         Attachments: ControllerThreadSocketFactoryTest.java, XMLRPCClientTest.java
>
>
> When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a NullPointerException. After debugging I see that the constructor call to java.net.InetSocketAddress throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from ReflectionSocketFactory.
> I suggest adding:
> if (cause instanceof IllegalArgumentException) {
>   throw (IllegalArgumentException) cause;
> }
> to give users of XmlRpcClient better error messages.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (XMLRPC-186) NullPointerException thrown for illegal port numbers

Posted by "Fredrik Wendt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/XMLRPC-186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fredrik Wendt updated XMLRPC-186:
---------------------------------

    Attachment: XMLRPCClientTest.java

This bug is only triggered when xmlrpcConfig.setConnectionTimeout(milliseconds) has been called.

> NullPointerException thrown for illegal port numbers
> ----------------------------------------------------
>
>                 Key: XMLRPC-186
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-186
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 3.1.3
>            Reporter: Fredrik Wendt
>            Priority: Minor
>         Attachments: XMLRPCClientTest.java
>
>
> When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a NullPointerException. After debugging I see that the constructor call to java.net.InetSocketAddress throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from ReflectionSocketFactory.
> I suggest adding:
> if (cause instanceof IllegalArgumentException) {
>   throw (IllegalArgumentException) cause;
> }
> to give users of XmlRpcClient better error messages.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (XMLRPC-186) NullPointerException thrown for illegal port numbers

Posted by "Fredrik Wendt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/XMLRPC-186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fredrik Wendt updated XMLRPC-186:
---------------------------------

    Attachment: ControllerThreadSocketFactoryTest.java

Cleanup of test.

> NullPointerException thrown for illegal port numbers
> ----------------------------------------------------
>
>                 Key: XMLRPC-186
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-186
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 3.1.3
>            Reporter: Fredrik Wendt
>            Priority: Minor
>         Attachments: ControllerThreadSocketFactoryTest.java, ControllerThreadSocketFactoryTest.java, XMLRPCClientTest.java
>
>
> When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a NullPointerException. After debugging I see that the constructor call to java.net.InetSocketAddress throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from ReflectionSocketFactory.
> I suggest adding:
> if (cause instanceof IllegalArgumentException) {
>   throw (IllegalArgumentException) cause;
> }
> to give users of XmlRpcClient better error messages.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (XMLRPC-186) NullPointerException thrown for illegal port numbers

Posted by "Fredrik Wendt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/XMLRPC-186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fredrik Wendt updated XMLRPC-186:
---------------------------------

    Attachment:     (was: ControllerThreadSocketFactoryTest.java)

> NullPointerException thrown for illegal port numbers
> ----------------------------------------------------
>
>                 Key: XMLRPC-186
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-186
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 3.1.3
>            Reporter: Fredrik Wendt
>            Priority: Minor
>         Attachments: ControllerThreadSocketFactoryTest.java, XMLRPCClientTest.java
>
>
> When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a NullPointerException. After debugging I see that the constructor call to java.net.InetSocketAddress throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from ReflectionSocketFactory.
> I suggest adding:
> if (cause instanceof IllegalArgumentException) {
>   throw (IllegalArgumentException) cause;
> }
> to give users of XmlRpcClient better error messages.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (XMLRPC-186) NullPointerException thrown for illegal port numbers

Posted by "Fredrik Wendt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/XMLRPC-186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fredrik Wendt updated XMLRPC-186:
---------------------------------

    Description: 
When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a NullPointerException. After debugging I see that the constructor call to java.net.InetSocketAddress throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from ReflectionSocketFactory.
I suggest adding:

if (cause instanceof IllegalArgumentException) {
  throw (IllegalArgumentException) cause;
}

to give users of XmlRpcClient better error messages.

  was:
When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a {{NullPointerException}}. After debugging I see that the constructor call to {{java.net.InetSocketAddress}} throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from {{ReflectionSocketFactory}}.
I suggest adding:
{{if (cause instanceof IllegalArgumentException) {
  throw (IllegalArgumentException) cause;
}
}}
to give users of XmlRpcClient better error messages.


Removed curly braces from description field.

> NullPointerException thrown for illegal port numbers
> ----------------------------------------------------
>
>                 Key: XMLRPC-186
>                 URL: https://issues.apache.org/jira/browse/XMLRPC-186
>             Project: XML-RPC
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 3.1.3
>            Reporter: Fredrik Wendt
>            Priority: Minor
>
> When you try to use an XmlRpcClient with an address containing an illegal port number (>65535), you get a NullPointerException. After debugging I see that the constructor call to java.net.InetSocketAddress throws a good exception: IllegalArgumentException("port out of range"), but this is silently ignored and null is returned from ReflectionSocketFactory.
> I suggest adding:
> if (cause instanceof IllegalArgumentException) {
>   throw (IllegalArgumentException) cause;
> }
> to give users of XmlRpcClient better error messages.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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