Research Log of Web Science Students

Computer Science is not simply programming

Finding a Web Implementation for Twitter4J: Unsupported Property Types in Google App Engine DataStore

with one comment

(INTRO: I can’t seem to figure out how to use Twitter4j Oauth in a web app. The code in the website only gives examples in a main method.

Googling Twitter4j Tutorial Web and other related searches returns nil useful results. Through this series of blogposts I HOPE to be able address this dearth.

My Problem: I’d like to be able to access the RequestToken and Twitter instantiations after authorizing from Twitter)

I am trying to persist an instantiation of class RequestToken onto Google’s DataStore. This is so that I can use that and an instantiation of the twitter class after Twitter redirects my user to the callback URL right after authorization.

But my unit tests (thank God for Test Driven Development) give me the following errors:

dataStore_unSupported

The following screenshot shows my unit test and it does not even test anything!

It already breaks in the setting up apart.
unitTest_dataStoreFail


package com.hardwire.model.app;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import twitter4j.Twitter;
import twitter4j.http.RequestToken;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class TwitterUser {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;

@Persistent
private String nickName;

@Persistent
private Twitter bridge;

@Persistent
private RequestToken request;

public String getNickName() {
return nickName;
}

public void setNickName(String nickName) {
this.nickName = nickName;
}

public Twitter getBridge() {
return bridge;
}

public void setBridge(Twitter bridge) {
this.bridge = bridge;
}

public RequestToken getRequest() {
return request;
}

public void setRequest(RequestToken request) {
this.request = request;
}

}

I wonder if this has anything to do with RequestToken being serializable? I’ve been thinking about that but the Twitter class is also serializable so that must not be it. Whatever is inside the RequestToken class, it’s not storing in the datastore!

Advertisements

Written by Jose Asuncion

August 24, 2009 at 4:02 pm

One Response

Subscribe to comments with RSS.

  1. […] my previous post I tried to store the RequestToken and Twitter instantiations to the Appengine’s datastore so […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: