Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1023681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:39:46+00:00 2026-05-16T11:39:46+00:00

EDIT: the null pointer was due to a badly formed json. Hi, I’m trying

  • 0

EDIT: the null pointer was due to a badly formed json.

Hi,

I’m trying to deserialize json data to an ArrayList of Restaurant object as follows (inpsired by what I found in https://sites.google.com/site/gson/gson-user-guide#TOC-Collections-Examples):

Type listType = new TypeToken<ArrayList<Restaurant>>() {}.getType();
ArrayList<Restaurant> objList = gson.fromJson( r, listType );         //(line 141)

but this gives the error shown at the end of the post.

It seems that there is some null pointer in listType… Here’s a watch of listType:

"listType"= ImplForType  (id=830061042288)  
    args= ListOfTypes  (id=830061040752)    
        list= null  
        resolvedTypes= Type[1]  (id=830061042800)   
    loader= PathClassLoader  (id=830060323064)  
    ownerType0= null    
    ownerTypeRes= null  
    rawType= Class (java.util.ArrayList) (id=830002592616)  
    rawTypeName= "java.util.ArrayList" (id=830061042328)    

What’s wrong with my code? How can I do that?

Thanks

Jul

07-06 17:38:48.825: DEBUG/dalvikvm(1337):   JDWP invocation returning with exceptObj=0x4364a4a0
07-06 17:39:00.525: DEBUG/dalvikvm(1337):   JDWP invocation returning with exceptObj=0x4364b1e8
07-06 17:39:15.879: WARN/dalvikvm(1337): threadid=17: thread exiting with uncaught exception (group=0x4000fe70)
07-06 17:39:15.885: ERROR/AndroidRuntime(1337): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception
07-06 17:39:16.135: DEBUG/dalvikvm(1337): GC freed 3322 objects / 261128 bytes in 114ms
07-06 17:39:16.225: ERROR/AndroidRuntime(1337): java.lang.RuntimeException: An error occured while executing doInBackground()
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.lang.Thread.run(Thread.java:1058)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337): Caused by: java.lang.NullPointerException
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.apache.harmony.luni.lang.reflect.ListOfTypes.length(ListOfTypes.java:47)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.apache.harmony.luni.lang.reflect.ImplForType.toString(ImplForType.java:83)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.lang.StringBuilder.append(StringBuilder.java:209)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:56)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializationVisitor.visitUsingCustomHandler(JsonDeserializationVisitor.java:65)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:96)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:73)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:49)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at com.google.gson.Gson.fromJson(Gson.java:379)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.digitalfarm.atable.Atable$GetRestaurantData.doInBackground(Atable.java:141)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at org.digitalfarm.atable.Atable$GetRestaurantData.doInBackground(Atable.java:1)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
07-06 17:39:16.225: ERROR/AndroidRuntime(1337):     ... 4 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:39:47+00:00Added an answer on May 16, 2026 at 11:39 am

    this is a known bug that we’ve fixed in gingerbread; see http://code.google.com/p/android/issues/detail?id=6636

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to erase a pointer to an object, but I keep crashing the
I've been trying to track down why my Office2010 plugin leaves a null pointer
object *head = NULL, *tail = NULL; // EDIT struct object { vector <int>
This is my json response : [{customer:{account_id:1,account_number:null,alt_contact:null,alt_phone:null,alt_phone_number:,balance:null,billing_address:341234 sucka ma cocka,billing_city:apple,billing_country:,billing_state:nj,billing_zip_code:021231,company_name:null,contact:null,created_at:2012-03-08T06:02:38-08:00,created_by:1,credit_limit:null,custom_datetime1:null,custom_datetime10:null,custom_datetime2:null,custom_datetime3:null,custom_datetime4:null,custom_datetime5:null,custom_datetime6:null,custom_datetime7:null,custom_datetime8:null,custom_datetime9:null,custom_number1:null,custom_number10:null,custom_number2:null,custom_number3:null,custom_number4:null,custom_number5:null,custom_number6:null,custom_number7:null,custom_number8:null,custom_number9:null,custom_text1:null,custom_text10:null,custom_text11:null,custom_text12:null,custom_text13:null,custom_text14:null,custom_text15:null,custom_text16:null,custom_text17:null,custom_text18:null,custom_text19:null,custom_text2:null,custom_text20:null,custom_text3:null,custom_text4:null,custom_text5:null,custom_text6:null,custom_text7:null,custom_text8:null,custom_text9:null,customer_number:151,customer_source_id:4,customer_type_id:2,customer_type_ref_full_name:null,delivery_method:null,edit_sequence:null,email:null,email_address:apple@adsfsd.com,fax:,first_name:null,full_name:123 Landscaping,id:431,is_active:null,is_statement_with_parent:null,item_sales_tax_ref_full_name:null,item_sales_tax_ref_list_id:null,job_desc:null,job_end_date:null,job_projected_end_date:null,job_start_date:null,job_status:null,job_type_ref_full_name:null,last_name:null,list_id:null,mobile:null,name:123 Landscaping,pager:null,parent_id:null,parent_ref_list_id:null,password:null,phone:234234234,phone_number:234234234,preferred_payment_method_ref_full_name:null,price_level_ref_full_name:null,qb_parent_list_id:null,resale_number:null,sales_rep_ref_full_name:null,sales_tax_code_ref_full_name:null,sales_tax_code_ref_list_id:null,service_address:341234 sucka ma
EDIT : proper solution: void add(Student s) { if(root == null) root = new
I'm getting null pointer exceptions when I try to initialize Button and EditText objects
When I try to use java.lang.System.console(), I get a null pointer. I can still
I am trying to deliver a char pointer to a function which then fills
im having a null pointer error. i tried making the button print by System.out.print
I am getting a null pointer exception every time the user selects logout (R.Id.logout)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.