[
https://issues.apache.org/jira/browse/AXIS2-5789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17127972#comment-17127972
]
ANN SONIYA JOHNY commented on AXIS2-5789:
-----------------------------------------
Hi,
We are using AXIS2 1.7.6 3PP in our application.
Facing the below runtime exception by the AXIS2 API :
We could see similar issue reported in JIRA in the below link:
https://issues.apache.org/jira/browse/AXIS2-5851
Could you please share the resolution for the same?
Do we need to upgrade to a later version which has the fix for the issue?
NumberFormatException
2020-06-03 11:31:02,634 ERROR [stderr] (pool-19-thread-4)
java.lang.NumberFormatException: For input string: "1
00.0"
2020-06-03 11:31:02,634 ERROR [stderr] (pool-19-thread-4)
java.lang.NumberFormatException: For input string: "1
00.0"
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
java.lang.NumberFormatException.forInputStri
ng(NumberFormatException.java:76)
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
java.lang.NumberFormatException.forInputStri
ng(NumberFormatException.java:76)
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
java.lang.Integer.parseInt(Integer.java:592)
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
java.lang.Integer.parseInt(Integer.java:592)
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
java.lang.Integer.parseInt(Integer.java:627)
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
java.lang.Integer.parseInt(Integer.java:627)
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
org.apache.axis2.databinding.utils.Converter
Util.compare(ConverterUtil.java:1289)
2020-06-03 11:31:02,635 ERROR [stderr] (pool-19-thread-4) at
org.apache.axis2.databinding.utils.Converter
Util.compare(ConverterUtil.java:1289)
Thanks
Ann
From: Ann Johny
Sent: Monday, June 8, 2020 12:04 PM
To: '[email protected]' <[email protected]>
Cc: Nidhin Kaladharan <[email protected]>
Subject: [jira] [Resolved] (AXIS2-5789) Generated code for xsd:totalDigits
throws NumberFormatException
Hi,
Can you share the resolution for this ticket AXI2-5789?
Thanks
Ann
> Generated code for xsd:totalDigits throws NumberFormatException
> ---------------------------------------------------------------
>
> Key: AXIS2-5789
> URL: https://issues.apache.org/jira/browse/AXIS2-5789
> Project: Axis2
> Issue Type: Bug
> Components: adb, codegen
> Affects Versions: 1.7.3
> Reporter: Stefano Rodi
> Priority: Major
>
> In relation to issue [https://issues.apache.org/jira/browse/AXIS2-5342],
> generated code for type:
> {code:xml}
> <simpleType name="INTERO3_TYPE">
> <restriction base="integer">
> <totalDigits value="3"/>
> </restriction>
> </simpleType>
> {code}
> produces a class with setter:
> {code:java}
> public void setINTERO3_TYPE(java.math.BigInteger param) {
> java.lang.String totalDigitsDecimal =
> org.apache.axis2.databinding.utils.ConverterUtil.convertToStandardDecimalNotation("3").toPlainString();
> if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param,
> totalDigitsDecimal) < 0) {
> this.localINTERO3_TYPE = param;
> } else {
> throw new java.lang.RuntimeException(
> "Input values do not follow defined XSD restrictions");
> }
> }
> {code}
> ConverterUtil.convertToStandardDecimalNotation produces a BigDecimal with a
> toPlainString() value "1000.0", but ConverterUtil.compare(BigInteger, String)
> contains code:
> {code:java|title=ConverterUtil.java:1344}
> public static long compare(BigInteger binBigInteger, String value) {
> return binBigInteger.longValue() - Long.parseLong(value);
> }
> {code}
> which parses second string parameter as a Long, throwing a
> NumberFormatException
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]