java.lang.VerifyError: org.springframework.social.support.HttpComponentsClientHttpRequestFactory

Spring JIRA | Roy Clarkson | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The version verification check works on Android API Level 7 (2.1) and higher, but not older versions. The VerifyError is happening because Spring Social is compiling against HttpComponents Client 4.1, and Android is executing against version 4.0. stack trace: E/dalvikvm( 703): Could not find method org.apache.http.conn.scheme.Scheme.<init>, referenced from method org.springframework.social.support.HttpComponentsClientHttpRequestFactory.<init> W/dalvikvm( 703): VFY: unable to resolve direct method 5898: Lorg/apache/http/conn/scheme/Scheme;.<init> (Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V W/dalvikvm( 703): VFY: rejecting opcode 0x70 at 0x001b W/dalvikvm( 703): VFY: rejected Lorg/springframework/social/support/HttpComponentsClientHttpRequestFactory;.<init> ()V W/dalvikvm( 703): Verifier rejected class Lorg/springframework/social/support/HttpComponentsClientHttpRequestFactory; D/AndroidRuntime( 703): Shutting down VM W/dalvikvm( 703): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 703): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 703): java.lang.VerifyError: org.springframework.social.support.HttpComponentsClientHttpRequestFactory E/AndroidRuntime( 703): at org.springframework.social.support.ClientHttpRequestFactorySelector.getRequestFactory(ClientHttpRequestFactorySelector.java:32) E/AndroidRuntime( 703): at org.springframework.social.oauth1.OAuth1Template.createRestTemplate(OAuth1Template.java:137) E/AndroidRuntime( 703): at org.springframework.social.oauth1.OAuth1Template.<init>(OAuth1Template.java:85) E/AndroidRuntime( 703): at org.springframework.social.oauth1.OAuth1Template.<init>(OAuth1Template.java:74) E/AndroidRuntime( 703): at org.springframework.social.twitter.connect.TwitterServiceProvider.<init>(TwitterServiceProvider.java:31) E/AndroidRuntime( 703): at org.springframework.social.twitter.connect.TwitterConnectionFactory.<init>(TwitterConnectionFactory.java:28) E/AndroidRuntime( 703): at org.springframework.android.showcase.social.twitter.TwitterConnectController.<init>(TwitterConnectController.java:62) E/AndroidRuntime( 703): at org.springframework.android.showcase.social.twitter.TwitterActivity.onCreate(TwitterActivity.java:48) E/AndroidRuntime( 703): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) E/AndroidRuntime( 703): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) E/AndroidRuntime( 703): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) E/AndroidRuntime( 703): at android.app.ActivityThread.access$1800(ActivityThread.java:112) E/AndroidRuntime( 703): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) E/AndroidRuntime( 703): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 703): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 703): at android.app.ActivityThread.main(ActivityThread.java:3948) E/AndroidRuntime( 703): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 703): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 703): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) E/AndroidRuntime( 703): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) E/AndroidRuntime( 703): at dalvik.system.NativeStart.main(Native Method)

    Spring JIRA | 6 years ago | Roy Clarkson
    java.lang.VerifyError: org.springframework.social.support.HttpComponentsClientHttpRequestFactory
  2. 0

    The version verification check works on Android API Level 7 (2.1) and higher, but not older versions. The VerifyError is happening because Spring Social is compiling against HttpComponents Client 4.1, and Android is executing against version 4.0. stack trace: E/dalvikvm( 703): Could not find method org.apache.http.conn.scheme.Scheme.<init>, referenced from method org.springframework.social.support.HttpComponentsClientHttpRequestFactory.<init> W/dalvikvm( 703): VFY: unable to resolve direct method 5898: Lorg/apache/http/conn/scheme/Scheme;.<init> (Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V W/dalvikvm( 703): VFY: rejecting opcode 0x70 at 0x001b W/dalvikvm( 703): VFY: rejected Lorg/springframework/social/support/HttpComponentsClientHttpRequestFactory;.<init> ()V W/dalvikvm( 703): Verifier rejected class Lorg/springframework/social/support/HttpComponentsClientHttpRequestFactory; D/AndroidRuntime( 703): Shutting down VM W/dalvikvm( 703): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 703): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 703): java.lang.VerifyError: org.springframework.social.support.HttpComponentsClientHttpRequestFactory E/AndroidRuntime( 703): at org.springframework.social.support.ClientHttpRequestFactorySelector.getRequestFactory(ClientHttpRequestFactorySelector.java:32) E/AndroidRuntime( 703): at org.springframework.social.oauth1.OAuth1Template.createRestTemplate(OAuth1Template.java:137) E/AndroidRuntime( 703): at org.springframework.social.oauth1.OAuth1Template.<init>(OAuth1Template.java:85) E/AndroidRuntime( 703): at org.springframework.social.oauth1.OAuth1Template.<init>(OAuth1Template.java:74) E/AndroidRuntime( 703): at org.springframework.social.twitter.connect.TwitterServiceProvider.<init>(TwitterServiceProvider.java:31) E/AndroidRuntime( 703): at org.springframework.social.twitter.connect.TwitterConnectionFactory.<init>(TwitterConnectionFactory.java:28) E/AndroidRuntime( 703): at org.springframework.android.showcase.social.twitter.TwitterConnectController.<init>(TwitterConnectController.java:62) E/AndroidRuntime( 703): at org.springframework.android.showcase.social.twitter.TwitterActivity.onCreate(TwitterActivity.java:48) E/AndroidRuntime( 703): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) E/AndroidRuntime( 703): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) E/AndroidRuntime( 703): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) E/AndroidRuntime( 703): at android.app.ActivityThread.access$1800(ActivityThread.java:112) E/AndroidRuntime( 703): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) E/AndroidRuntime( 703): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 703): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 703): at android.app.ActivityThread.main(ActivityThread.java:3948) E/AndroidRuntime( 703): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 703): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 703): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) E/AndroidRuntime( 703): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) E/AndroidRuntime( 703): at dalvik.system.NativeStart.main(Native Method)

    Spring JIRA | 6 years ago | Roy Clarkson
    java.lang.VerifyError: org.springframework.social.support.HttpComponentsClientHttpRequestFactory

    Root Cause Analysis

    1. java.lang.VerifyError

      org.springframework.social.support.HttpComponentsClientHttpRequestFactory

      at org.springframework.social.support.ClientHttpRequestFactorySelector.getRequestFactory()
    2. Foundational module containing the ServiceProvider Connect Framework and Service API invocation support.
      OAuth1Template.<init>
      1. org.springframework.social.support.ClientHttpRequestFactorySelector.getRequestFactory(ClientHttpRequestFactorySelector.java:32)
      2. org.springframework.social.oauth1.OAuth1Template.createRestTemplate(OAuth1Template.java:137)
      3. org.springframework.social.oauth1.OAuth1Template.<init>(OAuth1Template.java:85)
      4. org.springframework.social.oauth1.OAuth1Template.<init>(OAuth1Template.java:74)
      4 frames
    3. Twitter API
      TwitterConnectionFactory.<init>
      1. org.springframework.social.twitter.connect.TwitterServiceProvider.<init>(TwitterServiceProvider.java:31)
      2. org.springframework.social.twitter.connect.TwitterConnectionFactory.<init>(TwitterConnectionFactory.java:28)
      2 frames
    4. org.springframework.android
      TwitterActivity.onCreate
      1. org.springframework.android.showcase.social.twitter.TwitterConnectController.<init>(TwitterConnectController.java:62)
      2. org.springframework.android.showcase.social.twitter.TwitterActivity.onCreate(TwitterActivity.java:48)
      2 frames
    5. Android Platform
      ActivityThread.main
      1. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
      2. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
      3. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
      4. android.app.ActivityThread.access$1800(ActivityThread.java:112)
      5. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
      6. android.os.Handler.dispatchMessage(Handler.java:99)
      7. android.os.Looper.loop(Looper.java:123)
      8. android.app.ActivityThread.main(ActivityThread.java:3948)
      8 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:521)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
      2 frames
    8. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame