Uploaded image for project: 'WSO2 Carbon'
  1. WSO2 Carbon
  2. CARBON-7589

Problems occurred when I use field type for input of types: date, timestamp and int and I try passed "null" in value.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Highest
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.1.0
    • Labels:
      None
    • Environment:

      Ubuntu 10.04, Java 6

      Description

      My problems occurred when I use field type for input of types: date, timestamp and int and I try passed "null" in value.

      In attachment my service, mysql dump and patch to correction.

      Erros recevieds in log:
      === with all fields "NULL"
      Name: Products
      Location: /home/lsaraiva/Applications/wso2/wso2dataservices-2.5.0/repository/deployment/server/dataservices/Products.dbs
      Description: N/A
      Default Namespace: http://ws.wso2.org/dataservice
      Current Request Name: selectProduct
      Current Params:

      {id=null, updated_at=null, name=null, created_at=null, quantity=null}

      Nested Exception:-
      java.lang.NumberFormatException: For input string: "null"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:449)
      at java.lang.Integer.parseInt(Integer.java:499)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setIntValue(SQLQuery.java:1329)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setParamInPreparedStatement(SQLQuery.java:832)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.createProcessedPreparedStatement(SQLQuery.java:813)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.processNormalQuery(SQLQuery.java:471)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.runQuery(SQLQuery.java:1411)
      at org.wso2.carbon.dataservices.dispatch.query.Query.execute(Query.java:214)
      at org.wso2.carbon.dataservices.dispatch.CallQuery.execute(CallQuery.java:154)
      at org.wso2.carbon.dataservices.dispatch.CallQueryGroup.execute(CallQueryGroup.java:108)
      at org.wso2.carbon.dataservices.dispatch.operation.Operation.execute(Operation.java:63)
      at org.wso2.carbon.dataservices.dispatch.DataService.invoke(DataService.java:327)
      at org.wso2.carbon.dataservices.dispatch.DSOMDataSource.serialize(DSOMDataSource.java:90)

      === with id = 1 and other all fields "NULL"
      Name: Products
      Location: /home/lsaraiva/Applications/wso2/wso2dataservices-2.5.0/repository/deployment/server/dataservices/Products.dbs
      Description: N/A
      Default Namespace: http://ws.wso2.org/dataservice
      Current Request Name: selectProduct
      Current Params:

      {id=1, updated_at=null, name=null, created_at=null, quantity=null}

      Nested Exception:-
      java.lang.RuntimeException: In valid string to parse
      at org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(ConverterUtil.java:603)
      at org.wso2.carbon.dataservices.DBUtils.getDate(DBUtils.java:521)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setDateValue(SQLQuery.java:995)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setParamInPreparedStatement(SQLQuery.java:851)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.createProcessedPreparedStatement(SQLQuery.java:813)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.processNormalQuery(SQLQuery.java:471)
      at org.wso2.carbon.dataservices.dispatch.query.SQLQuery.runQuery(SQLQuery.java:1411)
      at org.wso2.carbon.dataservices.dispatch.query.Query.execute(Query.java:214)
      at org.wso2.carbon.dataservices.dispatch.CallQuery.execute(CallQuery.java:154)
      at org.wso2.carbon.dataservices.dispatch.CallQueryGroup.execute(CallQueryGroup.java:108)
      at org.wso2.carbon.dataservices.dispatch.operation.Operation.execute(Operation.java:63)
      at org.wso2.carbon.dataservices.dispatch.DataService.invoke(DataService.java:327)
      at org.wso2.carbon.dataservices.dispatch.DSOMDataSource.serialize(DSOMDataSource.java:90)

        Attachments

          Activity

            People

            • Assignee:
              anjana@wso2.com Anjana Fernando
              Reporter:
              vyper@maneh.org Leonardo Saraiva
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: