I setup an an android app using Spring Mobile and Spring Android 1.0.0.M2 according to the instructions on the respective pages. These libraries are being managed by Maven, so they should be pulling the correct versions listed above.
However, when I execute my code (no compile time errors) I get a runtime error
I have verified that the RestTemplate code does not contain this method.Code:03-04 16:22:09.036: ERROR/AndroidRuntime(6206): FATAL EXCEPTION: main 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): java.lang.NoSuchMethodError: org.springframework.web.client.RestTemplate.setInterceptors 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at org.springframework.social.oauth1.ProtectedResourceClientFactory.create(ProtectedResourceClientFactory.java:37) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at org.springframework.social.twitter.TwitterTemplate.<init>(TwitterTemplate.java:84) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at org.openschedule.util.TwitterPrefs.getTwitterTemplate(TwitterPrefs.java:131) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at org.openschedule.activities.twitter.TwitterActivity.postTweet(TwitterActivity.java:173) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at org.openschedule.activities.twitter.TwitterActivity.onCreate(TwitterActivity.java:74) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2701) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2753) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.app.ActivityThread.access$2500(ActivityThread.java:129) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2107) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.os.Handler.dispatchMessage(Handler.java:99) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.os.Looper.loop(Looper.java:143) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at android.app.ActivityThread.main(ActivityThread.java:4701) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at java.lang.reflect.Method.invokeNative(Native Method) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at java.lang.reflect.Method.invoke(Method.java:521) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 03-04 16:22:09.036: ERROR/AndroidRuntime(6206): at dalvik.system.NativeStart.main(Native Method)
It is being called from org.springframework.social.oauth1.ProtectedResourc eClientFactory
Thanks for any help.Code:public static RestTemplate create(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret) { RestTemplate client = new RestTemplate(); if (interceptorsSupported) { // favored client.setInterceptors(new ClientHttpRequestInterceptor[] { new OAuth1RequestInterceptor(consumerKey, consumerSecret, accessToken, accessTokenSecret)}); // HERE IS THE CODE BEING CALLED. } else { // 3.0.x compatibility client.setRequestFactory(new Spring30OAuth1RequestFactory(client.getRequestFactory(), consumerKey, consumerSecret, accessToken, accessTokenSecret)); } return client; }


Reply With Quote