org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2]

Spring JIRA | Mahesh Gujare | 2 years ago
  1. 0

    Twitter Login fails with below error log in android app that uses environment described above In Environment field. This was stable for over an year..but recently started throwing below error. I attempted to use latest versions of rest-template, twitter and fb repositories however not able to download org.springframework.android:spring-android-rest-template:2.0.0.M2 gradle build fails to locate rest template repo. fb and tw repos are available though. Please advise and kindly update the android samples on github. Thank you. 11-07 16:06:39.220: E/AndroidRuntime(1467): java.lang.RuntimeException: An error occured while executing doInBackground() 11-07 16:06:39.220: E/AndroidRuntime(1467): at android.os.AsyncTask$3.done(AsyncTask.java:300) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.run(FutureTask.java:242) 11-07 16:06:39.220: E/AndroidRuntime(1467): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.lang.Thread.run(Thread.java:841) 11-07 16:06:39.220: E/AndroidRuntime(1467): Caused by: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) 11-07 16:06:39.220: E/AndroidRuntime(1467): at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2]; nested exception is org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) 11-07 16:06:39.220: E/AndroidRuntime(1467): at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2] 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:125) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:147) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:76) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:484) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:453) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:251) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.twitter.api.impl.UserTemplate.getUserProfile(UserTemplate.java:54) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:30) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.AbstractConnection.setValues(AbstractConnection.java:172) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.AbstractConnection.initKey(AbstractConnection.java:135) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.OAuth1Connection.<init>(OAuth1Connection.java:57) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.OAuth1ConnectionFactory.createConnection(OAuth1ConnectionFactory.java:58) 11-07 16:06:39.220: E/AndroidRuntime(1467): at com.cbs.app.view.TwitterWebOAuthActivity$TwitterPostConnectTask.doInBackground(TwitterWebOAuthActivity.java:246) 11-07 16:06:39.220: E/AndroidRuntime(1467): at com.cbs.app.view.TwitterWebOAuthActivity$TwitterPostConnectTask.doInBackground(TwitterWebOAuthActivity.java:213) 11-07 16:06:39.220: E/AndroidRuntime(1467): at android.os.AsyncTask$2.call(AsyncTask.java:288) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 11-07 16:06:39.220: E/AndroidRuntime(1467): ... 4 more 11-07 16:06:39.220: E/AndroidRuntime(1467): Caused by: org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) 11-07 16:06:39.220: E/AndroidRuntime(1467): at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2] 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObjectUsingNonDefault(BeanDeserializer.java:746) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:683) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1923) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:122)

    Spring JIRA | 2 years ago | Mahesh Gujare
    org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2]
  2. 0

    Twitter Login fails with below error log in android app that uses environment described above In Environment field. This was stable for over an year..but recently started throwing below error. I attempted to use latest versions of rest-template, twitter and fb repositories however not able to download org.springframework.android:spring-android-rest-template:2.0.0.M2 gradle build fails to locate rest template repo. fb and tw repos are available though. Please advise and kindly update the android samples on github. Thank you. 11-07 16:06:39.220: E/AndroidRuntime(1467): java.lang.RuntimeException: An error occured while executing doInBackground() 11-07 16:06:39.220: E/AndroidRuntime(1467): at android.os.AsyncTask$3.done(AsyncTask.java:300) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.run(FutureTask.java:242) 11-07 16:06:39.220: E/AndroidRuntime(1467): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.lang.Thread.run(Thread.java:841) 11-07 16:06:39.220: E/AndroidRuntime(1467): Caused by: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) 11-07 16:06:39.220: E/AndroidRuntime(1467): at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2]; nested exception is org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) 11-07 16:06:39.220: E/AndroidRuntime(1467): at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2] 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:125) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:147) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:76) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:484) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:453) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:251) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.twitter.api.impl.UserTemplate.getUserProfile(UserTemplate.java:54) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:30) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.AbstractConnection.setValues(AbstractConnection.java:172) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.AbstractConnection.initKey(AbstractConnection.java:135) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.OAuth1Connection.<init>(OAuth1Connection.java:57) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.social.connect.support.OAuth1ConnectionFactory.createConnection(OAuth1ConnectionFactory.java:58) 11-07 16:06:39.220: E/AndroidRuntime(1467): at com.cbs.app.view.TwitterWebOAuthActivity$TwitterPostConnectTask.doInBackground(TwitterWebOAuthActivity.java:246) 11-07 16:06:39.220: E/AndroidRuntime(1467): at com.cbs.app.view.TwitterWebOAuthActivity$TwitterPostConnectTask.doInBackground(TwitterWebOAuthActivity.java:213) 11-07 16:06:39.220: E/AndroidRuntime(1467): at android.os.AsyncTask$2.call(AsyncTask.java:288) 11-07 16:06:39.220: E/AndroidRuntime(1467): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 11-07 16:06:39.220: E/AndroidRuntime(1467): ... 4 more 11-07 16:06:39.220: E/AndroidRuntime(1467): Caused by: org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) 11-07 16:06:39.220: E/AndroidRuntime(1467): at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2] 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObjectUsingNonDefault(BeanDeserializer.java:746) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:683) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1923) 11-07 16:06:39.220: E/AndroidRuntime(1467): at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:122)

    Spring JIRA | 2 years ago | Mahesh Gujare
    org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2]
  3. 0

    Jackson - cannot seserialize array, UnknownLengthHttpInputStream

    sohu.io | 1 year ago
    org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.miquido.vheda_android.chat.response.ConnectResponse out of START_ARRAY token at [Source: libcore.net.http.UnknownLengthHttpInputStream@41fa3030; line: 1, column: 1]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Could not read JSON? Issue while mapping from json to pojo

    Stack Overflow | 1 year ago | Ritesh
    org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.singh.ritesh.movies.model.MovieDataList out of START_OBJECT token at [Source: buffer(com.android.okio.GzipSource@3bbd7348).inputStream(); line: 1, column: 1]
  6. 0

    Spring and Jackson Mapper Can not deserialize instance of CUSTOM_CLASS out of START_OBJECT - Android - Android Puzzles(Questions & Answers)

    phonesdevelopers.com | 9 months ago
    org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at [Source: ; line: 1, column: 1]

    28 unregistered visitors
    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. org.codehaus.jackson.map.JsonMappingException

      No suitable constructor found for type [simple type, class org.springframework.social.twitter.api.TwitterProfile]: can not instantiate from JSON object (need to add/enable type information?) at [Source: org.apache.http.conn.EofSensorInputStream@421ffbe8; line: 1, column: 2]

      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObjectUsingNonDefault()
    2. Data Mapper for Jackson
      ObjectMapper.readValue
      1. org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObjectUsingNonDefault(BeanDeserializer.java:746)
      2. org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:683)
      3. org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
      4. org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732)
      5. org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1923)
      5 frames
    3. Spring
      MappingJacksonHttpMessageConverter.readInternal
      1. org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:122)
      1 frame