1

I used Scribe1.2.jar file for implementing twitter.I use the following code

OAuthService service = new ServiceBuilder().provider(TwitterApi.class).apiKey("key").apiSecret("secret").build();
Token requestToken = service.getRequestToken();

When i compile the code, its showing the following error - org/scribe/builder/api/Api.class: Error!: Invalid class file: Incorrect classfile version. The same problem happends in Linkedin also. How to resolve the problem ?. I referred this link scribe doc

Rince Thomas
  • 4,158
  • 5
  • 25
  • 44

1 Answers1

2

The jars you mentioned, scribe-1.2.0.jar and Linkedin-j.jar (You didn't mention the LinkedIn's one explicitly, but I guess you meant this one) are Java SE versions and can't be used on BlackBerry. You need to look for Java ME versions and if you find ones, you need to preverify them first.

Refer to this question on additional information on preverification.

Update: I downloaded scribe-1.2.0.jar and tried to preverify it. I got the following error:

Error preverifying class org.scribe.extractors.BaseStringExtractorImpl VERIFIER ERROR org/scribe/extractors/BaseStringExtractorImpl.getSortedAndEncodedParams(Lorg/scribe/model/OAuthRequest;)Ljava/lang/String;: Cannot find class java/util/Map

The reason is that java.util.Map doesn't exist in Java ME.

Community
  • 1
  • 1
tonymontana
  • 5,728
  • 4
  • 34
  • 53
  • I used https://github.com/fernandezpablo85/scribe-java/downloads. This is for Java ME. – Rince Thomas Feb 21 '12 at 12:57
  • For Code check https://github.com/fernandezpablo85/scribe-java/tree/master/src/test/java/org/scribe/examples – Rince Thomas Feb 21 '12 at 12:58
  • @Signare What makes you think it is Java ME version? Check scribe's [OAuthRequest.java](https://github.com/fernandezpablo85/scribe-java/blob/master/src/main/java/org/scribe/model/OAuthRequest.java) line 15. `private Map oauthParameters;` Doesn't seem like Java ME to me. – tonymontana Feb 21 '12 at 13:14
  • 1
    Sorry scribe indeed uses `Map`. I've never said it was compatible with java ME, but perhaps I could do it if it isn't a big deal – Pablo Fernandez Feb 21 '12 at 21:57
  • @pablo I guess you will make a lot of people happy if you do it. Not sure about the *big deal* though. I am not too much familiar with scribe's code. – tonymontana Feb 21 '12 at 22:13
  • @pablo IMHO it will not end with just leaving `Map` out. – tonymontana Feb 21 '12 at 22:52
  • @PabloFernandez so what should i do ?. Scribe is not useful for blackberry ?. – Rince Thomas Feb 23 '12 at 09:39
  • Not for now at least. You can either fork it and change the parts that are not ME compatible or identify them, raise an issue and I'll take care of it when I have time – Pablo Fernandez Feb 23 '12 at 18:49