java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

Appcelerator JIRA | Wilson Luu | 10 months ago
  1. 0

    *Details:* Calling the {{findAll}} method in Arrow Android SDK throws a {{java.lang.ClassCastException}} in the {{onError}} callback. *Notes:* * To workaround this issue, go into the model class and replace {{retVal.setID((Integer) object.get("id"));}} with {{retVal.setID(Integer.getInteger((String) object.get("id")));}}. * The workaround seems to only work with models that have an id field of type string. *Steps to reproduce:* # Download and unzip MonkeyArr.zip; this is a *Android Studio* project # Open the project in Android Studio # If API-1196 is not fixed, apply the workaround from that ticket # Next, create an Arrow project and run the Arrow project locally # In the Android project, open {{MainActivity.java}} and change the following: ## Replace the API key in {{MonkeySdk.setAuthorization("71YFaz201s55+Mmvzh5G62sqo3tUwwbS")}}. ## If you are planning to launch against the stock emulator, replace {{10.0.3.2}} with {{10.0.2.2}}; otherwise, leave as-is. # Launch Android app to emualtor or Genymotion emulator # Press the {{Test}} button *Actual:* {{java.lang.ClassCastException}} is thrown in the {{onError}} callback of {{Testuser.findAll}}: {code} 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at com.monkeysdk.Testuser.parse(Testuser.java:24) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at com.monkeysdk.Testuser$3.doInBackground(Testuser.java:208) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at com.monkeysdk.Testuser$3.doInBackground(Testuser.java:191) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:288) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 02-09 20:32:20.213 5741-5933/com.appc.monkeyarr W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 02-09 20:32:20.213 5741-5933/com.appc.monkeyarr W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 02-09 20:32:20.213 5741-5933/com.appc.monkeyarr W/System.err: at java.lang.Thread.run(Thread.java:818) {code} *Expected:* No exception should be thrown when making a {{Testuser.findAll}} call.

    Appcelerator JIRA | 10 months ago | Wilson Luu
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
  2. 0

    *Details:* Calling the {{findAll}} method in Arrow Android SDK throws a {{java.lang.ClassCastException}} in the {{onError}} callback. *Notes:* * To workaround this issue, go into the model class and replace {{retVal.setID((Integer) object.get("id"));}} with {{retVal.setID(Integer.getInteger((String) object.get("id")));}}. * The workaround seems to only work with models that have an id field of type string. *Steps to reproduce:* # Download and unzip MonkeyArr.zip; this is a *Android Studio* project # Open the project in Android Studio # If API-1196 is not fixed, apply the workaround from that ticket # Next, create an Arrow project and run the Arrow project locally # In the Android project, open {{MainActivity.java}} and change the following: ## Replace the API key in {{MonkeySdk.setAuthorization("71YFaz201s55+Mmvzh5G62sqo3tUwwbS")}}. ## If you are planning to launch against the stock emulator, replace {{10.0.3.2}} with {{10.0.2.2}}; otherwise, leave as-is. # Launch Android app to emualtor or Genymotion emulator # Press the {{Test}} button *Actual:* {{java.lang.ClassCastException}} is thrown in the {{onError}} callback of {{Testuser.findAll}}: {code} 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at com.monkeysdk.Testuser.parse(Testuser.java:24) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at com.monkeysdk.Testuser$3.doInBackground(Testuser.java:208) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at com.monkeysdk.Testuser$3.doInBackground(Testuser.java:191) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:288) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 02-09 20:32:20.212 5741-5933/com.appc.monkeyarr W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 02-09 20:32:20.213 5741-5933/com.appc.monkeyarr W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 02-09 20:32:20.213 5741-5933/com.appc.monkeyarr W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 02-09 20:32:20.213 5741-5933/com.appc.monkeyarr W/System.err: at java.lang.Thread.run(Thread.java:818) {code} *Expected:* No exception should be thrown when making a {{Testuser.findAll}} call.

    Appcelerator JIRA | 10 months ago | Wilson Luu
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
  3. 0

    Execution Error, return code 2 while executing query in hive for twitter sentiment analysis

    Stack Overflow | 3 weeks ago | Ayushi Jain
    org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Bug on Adobe air for Android? - Pushwoosh Community

    pushwoosh.com | 4 days ago
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.String cannot be cast to java.lang.Integer

      at com.monkeysdk.Testuser.parse()
    2. com.monkeysdk
      Testuser$3.doInBackground
      1. com.monkeysdk.Testuser.parse(Testuser.java:24)
      2. com.monkeysdk.Testuser$3.doInBackground(Testuser.java:208)
      3. com.monkeysdk.Testuser$3.doInBackground(Testuser.java:191)
      3 frames
    3. Android Platform
      AsyncTask$2.call
      1. android.os.AsyncTask$2.call(AsyncTask.java:288)
      1 frame
    4. Java RT
      FutureTask.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:237)
      1 frame
    5. Android Platform
      AsyncTask$SerialExecutor$1.run
      1. android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
      1 frame