Question:
1. This problem occurs first because it is not handled properly during type conversion, and non null judgment is required
Solution:
String val =””;
if (val!=null && !val.equals("")){ merchantDetailData.setTransactionAmount(new BigDecimal(StringUtils.nvl(list.get(9)))); }
Only when the judgment value is not equal to null and not equal to “”
Read More:
- [Solved] Swagger Startup Error: java.lang.NumberFormatException: For input string: ““
- [Solved] swagger Docmentation Access Error: Illegal DefaultValue 1024 for parameter type integer, java.lang.NumberFormatException
- Non empty judgment method: the difference between isnotempty and isnotblank. isNullOrEmpty
- Error: char cannot be dereferenced [How to Solve]
- [Solved] Java Run Error: For input string: “XXX”
- [Solved] Java.util.linkedhashmap cannot be cast to entity class
- The problem of date format conversion between springboot and front end
- [Solved] JPA query data error: Page 1 of 0 containing UNKNOWN instances
- Conversion of two data types in Java
- [Solved] Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- Comparison method violates its general contract [How to Solve]
- mybatis “case when” Error: Failed to process, please exclude the tableName or statementId.
- [Solved] Mybatis insert Error: Cause: java.sql.SQLException: SQL String cannot be empty
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘testApplicat
- mybatis Error: All elements are null [How to Solve]
- [Solved] Scala error: type mismatch; found : java.util.List[?0] required: java.util.List[B]
- org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deseria
- JAVA: How to Read JSON Format Data (Web Game Development)
- The precision of decimal calculation with double and float in Java is not accurate
- Not showing null elements JAVA [How to Solve]