我正在开发一个使用Facebook-SDKv3的Android-App,所以我在strings.xml中创建了一个条目:
<resources>
<string name="facebook_app_id">"12345678910"</string>
</resources>
Run Code Online (Sandbox Code Playgroud)
并将以下内容添加到Manifest中:
<application>
...
<meta-data android:name="com.facebook.sdk.ApplicationId" android:resource="@string/facebook_app_id" />
</application>
Run Code Online (Sandbox Code Playgroud)
我总是得到这个例外:
02-06 16:35:01.231:W/Bundle(8316):键com.facebook.sdk.ApplicationId expected String但值是java.lang.Integer.返回了默认值.
02-06 16:35:01.231:W/Bundle(8316):尝试转换生成的内部异常:
02-06 16:35:01.231:W/Bundle(8316):java.lang.ClassCastException:java.lang.Integer无法转换为java.lang.String
02-06 16:35:01.231:W/Bundle(8316):在android.os.Bundle.getString(Bundle.java:1061)
02-06 16:35:01.231:W/Bundle(8316):at com.facebook.internal.Utility.getMetadataApplicationId(Utility.java:159)
我已经尝试将数字放入""但这并没有解决问题,希望有人可以帮助我.
我有一个像这样的ManyToMany-Association:
@Entity
public class User extends Model implements RoleHolder {
@ManyToMany(cascade=CascadeType.ALL)
public List<Task> tasks;
}
Run Code Online (Sandbox Code Playgroud)
然后我这样做:
User u = Application.getLocalUser(session());
u.tasks.clear();
for (Task t : tasksToAdd)
u.tasks.add(t);
u.saveManyToManyAssociations("tasks");
u.update()
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在Controller-Action中读取Collection时,只有一个"BeanList deferred"-Message
User u = Application.getLocalUser(session());
return ok(tasks.render(u.tasks));
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助
我刚刚开始使用Google AppEngine进行开发,现在我遇到了第一个问题.
我从Google-IO 2011中获取了Todo-Example-Project并进行了一些更改,现在我在我的应用程序中获得了以下StackTrace:
Caused by: java.lang.NullPointerException: null
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.doFire(AbstractRequestContext.java:1102)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.fire(AbstractRequestContext.java:569)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequest.fire(AbstractRequest.java:54)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequest.fire(AbstractRequest.java:59)
Run Code Online (Sandbox Code Playgroud)
我尝试使用此代码在GWT-Client中创建一个新实体:
MyRequest request = requestFactory.myRequest();
request.createTime().fire();
Run Code Online (Sandbox Code Playgroud)
服务级别的代码
static DataStore db = new DataStore();
public static Time createTime() {
return db.update(new Time());
}
Run Code Online (Sandbox Code Playgroud)
这是数据存储级中的代码
public Time update(Time item) {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
pm.makePersistent(item);
return item;
} finally {
pm.close();
}
}
Run Code Online (Sandbox Code Playgroud)
我希望你能帮我解决这个问题.
谢谢
编辑:我想我应该补充一下,当然我已经实现了一个TimeLocator-Class和一个ServiceLocator-Class.
这是我的web.xml,因为我认为可能存在问题:
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemalocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- Default page to serve …Run Code Online (Sandbox Code Playgroud)