I'm following this guide trying to get a database for my chrome packaged app: http://code.google.com/p/gwt-mobile-webkit/wiki/DataServiceUserGuide
I have added gwt-html5-database.jar
to my classpath (it shows up under Referenced Libraries), I put <inherits name="com.google.code.gwt.database.Html5Database" />
in my gwt.xml.
I created MyDataService.java in the .client package, it contains:
package com.example.myproject.client;
import com.google.code.gwt.database.client.service.*;
@Connection(name = "myDatabase", version = "1.0", description = "My Database", maxsize = 10000) public interface MyDataService extends DataService {
@Update("CREATE TABLE IF NOT EXISTS testtable (" + "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " + "adate INTEGER") void initDatabase(VoidCallback callback); }
In my main class Test.java (in client package), I have
package com.example.myproject.client;
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT;
public class Levels implements EntryPoint { MyDataService dbService = GWT.create(MyDataService.class); public void onModuleLoad() { } }
I believe I followed the instructions exactly, yet every time I run my app it doesn't work and says [ERROR] [Test] Failed to create an instance of 'com.example.myproject.client.Test' via deferred binding
If I remove the MyDataService dbService = GWT.create(MyDataService.class);
, it loads, so I think the problem is there. Any ideas?