seanchenxi / gwt-storage Goto Github PK
View Code? Open in Web Editor NEWGWT Storage, a simple GWT Client-side HTML5 Web Storage API, Supports Object values
License: Apache License 2.0
GWT Storage, a simple GWT Client-side HTML5 Web Storage API, Supports Object values
License: Apache License 2.0
gwt-storage version: 1.2.1-SNAPSHOT
Truncated stack trace:
[INFO] Caused by: java.lang.NoSuchMethodError: com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.<init>(Lcom/google/gwt/core/ext/TreeLogger;Lcom/google/gwt/core/ext/PropertyOracle;Lcom/google/gwt/core/ext/GeneratorContext;)V
[INFO] at com.seanchenxi.gwt.storage.rebind.StorageTypeSerializerGenerator.buildSerializableTypeOracle(StorageTypeSerializerGenerator.java:89)
[INFO] at com.seanchenxi.gwt.storage.rebind.StorageTypeSerializerGenerator.generateIncrementally(StorageTypeSerializerGenerator.java:61)
I'll do a PR when I have the fix for this.
@seanchenxi StorageSerializerPoilcy.gwt.rpc includes files that are blacklisted in the gwt.xml module.
So compile size is larger than before.
[INFO] Tracing compile failure path for type 'com.seanchenxi.gwt.storage.client.serializer.StorageSerializationStreamWriter'
[INFO] [ERROR] Errors in 'com/seanchenxi/gwt/storage/client/serializer/StorageSerializationStreamWriter.java'
[INFO] [ERROR] Line 66: The method toBase64(long) is undefined for the type LongLib
This incompatibility comes from this commit: gwtproject/gwt@1788c0b
Hi @seanchenxi
My question is not directly related to gwt-storage but gwt-storage could be a part of the solution so can you take a look of this post plz?
http://stackoverflow.com/questions/27720895/gwt-rpc-serialization-for-dynamic-host-page
I implemented a Dynamic Host Page (http://www.gwtproject.org/articles/dynamic_host_page.html) in my GWT project to pass my User POJO object directly in it.
I did it with AutoBean (https://code.google.com/p/google-web-toolkit/wiki/AutoBean) so I had to declare and implement Interfaces
But I found this way a little bit too verbose.
Is there another way? I mean GWT RPC do serialization without Interfaces so can I use it?
Another point; I already use the gwt-storage lib (https://github.com/seanchenxi/gwt-storage) that uses the GWT RPC mechanisim to store Java POJO Object in the Browser so there is probably an easy way...
THX
Hello Xi,
Many thanks for sharing the gwt-storage code, it is interesting and surprising to learn that GWT-RPC serialization is asymmetric, necessitating the construction of a client side serialisation implementation like you have done.
I am keen to use the serialisation code in our projects, however, I am unable to run the code in a GWTTestCase, is there a reason why it might not run in GWTTestCases?
I have pretty much followed your code examples and created a simple GWTTestCase, on running the command mvn clean verify
I keep getting the following error:
[INFO] testSerializerDirectly(org.wwarn.surveyor.util.client.SerializationUtilGwtTest) Time elapsed: 21.907 sec <<< ERROR!
[INFO] com.google.gwt.user.client.rpc.SerializationException: could not get type signature for class org.wwarn.surveyor.util.client.TestValue
[INFO] at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:125)
[INFO] at com.seanchenxi.gwt.storage.client.serializer.StorageValueType$15.write(StorageValueType.java:214)
[INFO] at com.seanchenxi.gwt.storage.client.serializer.StorageRPCSerializerImpl.serialize(StorageRPCSerializerImpl.java:88)
[INFO] at org.wwarn.surveyor.util.client.SerializationUtilGwtTest.testSerializerDirectly(SerializationUtilGwtTest.java:37)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:601)
[INFO] at com.google.gwt.junit.client.impl.GWTTestAccessor.invoke(GWTTestAccessor.java:39)
[INFO] at com.google.gwt.junit.client.impl.GWTRunner.executeTestMethod(GWTRunner.java:226)
[INFO] at com.google.gwt.junit.client.GWTTestCase.doRunTest(GWTTestCase.java:157)
[INFO] at junit.framework.TestCase.runTest(TestCase.java:59)
[INFO] at com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:151)
[INFO] at com.google.gwt.junit.client.GWTTestCase.__doRunTest(GWTTestCase.java:115)
[INFO] at com.google.gwt.junit.client.impl.GWTRunner.runTest(GWTRunner.java:302)
[INFO] at com.google.gwt.junit.client.impl.GWTRunner.doRunTest(GWTRunner.java:235)
[INFO] at com.google.gwt.junit.client.impl.GWTRunner.access$9(GWTRunner.java:229)
[INFO] at com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner.java:106)
[INFO] at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:61)
[INFO] at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:1)
[INFO] at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
[INFO] at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:250)
[INFO] at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:601)
[INFO] at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
[INFO] at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
[INFO] at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
[INFO] at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:341)
[INFO] at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:222)
[INFO] at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:137)
[INFO] at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:589)
[INFO] at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
[INFO] at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
[INFO] at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
[INFO] at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:306)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:601)
[INFO] at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
[INFO] at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
[INFO] at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
[INFO] at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:296)
[INFO] at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:551)
[INFO] at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
[INFO] at java.lang.Thread.run(Thread.java:722)
Any thoughts? Perhaps there is a good reason to avoid using GWTTestCases!
Many thanks,
Nigel
Not a tech issue but a documentation issue.
You introduced StorageKeyProvider in 1.2.0 can you provide an implementation sample plz?
THX
Would be useful to extend the storage api to support IndexedDB and/or WebSQL, this would require migration to a asynchronous API. The premise of the current storage api's is to extend GWT HTML5 Storage API, which is great, however now a little dated. I'd like to suggest we extend the localforage api's instead, these are frequently updated and degrades gracefully in browsers that do not support either IndexedDB or WebSQL.
What are your thoughts?
Best wishes,
Nigel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.