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 "ruudfeen (JIRA)" <ji...@apache.org> on 2017/04/18 14:02:43 UTC

[jira] [Updated] (AXIS2-5661) Axis2 1.6.2 @ Websphere 8.5 emits NumberFormatException intermittently.

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

ruudfeen updated AXIS2-5661:
----------------------------
    Attachment: AXIS-5661.patch

This issue still exists in 1.7.4

Hereby a patch which should fix this issue.

> Axis2 1.6.2 @ Websphere 8.5 emits NumberFormatException intermittently.
> -----------------------------------------------------------------------
>
>                 Key: AXIS2-5661
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5661
>             Project: Axis2
>          Issue Type: Improvement
>          Components: transports
>    Affects Versions: 1.6.2
>         Environment: Websphere 8.5 on Linux
>            Reporter: ARUNKUMAR NOHWAR
>              Labels: easyfix, patch
>         Attachments: AXIS-5661.patch
>
>
> Recently we upgraded from[Axis2-1.4.1 on Websphere-7.0] to [Axis2-1.6.2 on Websphere-8.5]. And the same application code start giving an intermittent exception. The stacktrace of the exception can be found at the end of the description.
> Analysis - 
> The creation of these system properties is the root cause of the issue.
> http.proxyHost  and   http.proxyPort
> These system porperties are created with non-null but empty string "" values.
> We find that our application has no logic to create these properties. These properties probably created by a 3rd party library or websphere server.
> Workaround -
> We write a code to remove these system properties (System.clearProperty()) just before the flow goes to Axis2 part of the application.
> We cannot write this code during application startup as these properties are created intermittently when the application is running for few days and the exception appears again.
> Recommendations -
> In this axis code 
> package    org.apache.axis2.transport.http.util
> class          HTTPProxyConfigurationUtil
> method       configure(MessageContext messageContext,
>                                  HttpClient httpClient,
>                                  HostConfiguration config) 
> the exception appears at the following line of code -
>         String port = System.getProperty(HTTP_PROXY_PORT);
>         if(port != null) {
>             proxyPort = Integer.parseInt(port);
>         }
> This is because the non-null but empty-string ("") valued key HTTP_PROXY_PORT, results in NumberFormatException.
> Can we please add an empty-string value check in the "if" condition ?
> Adding further thse empty-string valued keys, both host and port, might overwrite the correct values built from axis2.xml. Hence we can apply the same checks to both of the system properties - host and port - if conditions.
> StackTrace -
> java.lang.reflect.InvocationTargetException
>                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
>                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
>                 at java.lang.reflect.Method.invoke(Method.java:611)
> …….
>                 at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
>                 at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
>                 at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
>                 at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
> Caused by: java.lang.NumberFormatException: For input string: ""
>                 at java.lang.NumberFormatException.forInputString(NumberFormatException.java:59)
>                 at java.lang.Integer.parseInt(Integer.java:481)
>                 at java.lang.Integer.parseInt(Integer.java:510)
>                 at org.apache.axis2.transport.http.util.HTTPProxyConfigurationUtil.configure(HTTPProxyConfigurationUtil.java:154)
>                 at org.apache.axis2.transport.http.AbstractHTTPSender.getHostConfiguration(AbstractHTTPSender.java:294)
>                 at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:591)
>                 at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
>                 at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
>                 at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
>                 at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
>                 at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
>                 at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
>                 at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
>                 at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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