2
votes

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?

1

1 Answers

1
votes

Which version of GWT are you using? I have the same issue with 2.4 version, but everything works fine in 2.0. Check out this issue and BuildingFromSource Wiki page of gwt-mobile-webkit project. It seems that library is simply not compatible with latest versions of GWT.