roadlabs / gwt-mobile-webkit

Automatically exported from code.google.com/p/gwt-mobile-webkit
0 stars 0 forks source link

IE8 Local Storage Crashing #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Eclipse Helios 32-bit, Win7, GWT 2.0.4 
2. Hosted Mode (I think... Run as Web Application
3. IE8

What is the expected output? What do you see instead?
When IE8 comes to Storage.getLength(), or 
localmail = Storage.getLocalStorage();
    if(localmail.getLength()>0){
.....}
When IE8 comes to the getLength part, it crashes on the client side.

What version of the product are you using? On what operating system?

Please provide any additional information below.

com.google.gwt.dev.shell.BrowserChannel$RemoteDeathError: Remote connection lost
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1731)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1669)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Connection reset by peer: socket write 
error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(Unknown Source)
    at java.net.SocketOutputStream.write(Unknown Source)
    at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
    at java.io.BufferedOutputStream.flush(Unknown Source)
    at java.io.DataOutputStream.flush(Unknown Source)
    at com.google.gwt.dev.shell.BrowserChannel$FreeMessage.send(BrowserChannel.java:789)
    at com.google.gwt.dev.shell.BrowserChannel.sendFreedValues(BrowserChannel.java:1863)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1716)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1669)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
    at java.lang.Thread.run(Unknown Source)

Original issue reported on code.google.com by kirtcat...@gmail.com on 15 Aug 2010 at 9:35

GoogleCodeExporter commented 9 years ago
I have exactly the same issue, in the same setup.
Can you please take a look at this at your earliest opportunity ?
Local Storage is critical to my application.

Thank you

Original comment by tech...@gmail.com on 17 Aug 2010 at 8:06

GoogleCodeExporter commented 9 years ago
Seems to work just fine when the application is served in Tomcat.

Original comment by kirtcat...@gmail.com on 18 Aug 2010 at 4:28

GoogleCodeExporter commented 9 years ago
Yes, thank you. So it seems to be hosted mode only ...
Would be good to have it work there as well, of course.

Original comment by tech...@gmail.com on 18 Aug 2010 at 8:37

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. Will get back to this issue as soon as I can.

After a short investigation, the 'length' property is defined in IE8's Storage 
API (http://msdn.microsoft.com/en-us/library/cc304101(v=VS.85).aspx), and the 
length property is obtained in JSNI code as it is supposed to be. Code-wise it 
seems to do exactly what is needed.

Is this the only error you're seeing?

Hmm!

Original comment by bguijt on 21 Aug 2010 at 9:01

GoogleCodeExporter commented 9 years ago

Original comment by bguijt on 21 Aug 2010 at 9:02

GoogleCodeExporter commented 9 years ago

Did not see your question at first, sorry ...

In my case, somehow, IE8 crashes always happen on any storage access ( 
"StorageImpl.getItem" (see below) ).
My main environment is MAC - and there are no problems there.
Now that I am starting to test more on Win, this is becoming a real nuisance. 

If you have any insights on this, I will appreciate.

Thank you.

---------------------

Caused by: java.net.SocketException: Connection reset   
at java.net.SocketInputStream.read(SocketInputStream.java:168)  
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)   
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)   
at java.io.DataInputStream.readByte(DataInputStream.java:248)   
at 
com.google.gwt.dev.shell.BrowserChannel$Message.readMessageType(BrowserChannel.j
ava:1100)   
at 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForRetu
rn(BrowserChannelServer.java:325)   
at 
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelSer
ver.java:217)   
at 
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)   
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:510)  
at 
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)   
at 
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:9
1)  

at 
com.google.code.gwt.storage.client.impl.StorageImpl.getItem(StorageImpl.java)   
at com.google.code.gwt.storage.client.Storage$.getItem$(Storage.java:157) 

at 
com.blitzwriter.client.database.essay.BwEssayStorageMgr.readEssay(BwEssayStorage
Mgr.java:43)    
at 
com.blitzwriter.client.view.essay.BwViewEssayHTML5.openEssayLocal(BwViewEssayHTM
L5.java:136)    
at 
com.blitzwriter.client.view.essay.BwViewEssayHTML5.onPatternTreeLoaded(BwViewEss
ayHTML5.java:223)   
at com.blitzwriter.client.view.essay.BwViewEssay.access$2(BwViewEssay.java:1)   
at 
com.blitzwriter.client.view.essay.BwViewEssay$2.onSuccess(BwViewEssay.java:138) 

at com.google.gwt.core.client.GWT.runAsyncWithoutCodeSplitting(GWT.java:283)    
at com.google.gwt.core.client.GWT.runAsync(GWT.java:227)    

at 
com.blitzwriter.client.controller.BlitzEntryPoint$2.onResponseReceived(BlitzEntr
yPoint.java:128)    
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)  
at 
com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.ja
va:395)     
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)   
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)   
at java.lang.reflect.Method.invoke(Method.java:597)     
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)    
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)   
at 
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:154
)   
at 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForRetu
rn(BrowserChannelServer.java:336)   
at 
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelSer
ver.java:217)   
at 
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)   
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:510)  
at 
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)   
at 
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:9
1)  
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)    
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214) 
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)     
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)   
at java.lang.reflect.Method.invoke(Method.java:597)     
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)    
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)   
at 
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:154
)   
at 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServ
er.java:291)    
at 
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelSe
rver.java:541)  
at 
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:362)

at java.lang.Thread.run(Thread.java:619)

Original comment by tech...@gmail.com on 16 Sep 2010 at 6:36

GoogleCodeExporter commented 9 years ago

I just tried disabling storage access on startup, to rule out any possible 
initialization issues, and simply tried saving an item to storage on menu 
click. Got the same exception as reported by kirtcathey above.

Original comment by tech...@gmail.com on 16 Sep 2010 at 7:26

GoogleCodeExporter commented 9 years ago
Any update on this? Still premature to render a full assessment, but seems to 
be the same thing with IE9 as well.

Original comment by kirtcat...@gmail.com on 25 Sep 2010 at 4:41

GoogleCodeExporter commented 9 years ago
If anyone could provide any clues, I would appreciate it - need this to work 
really bad right now.
Thank you.

Original comment by tech...@gmail.com on 30 Sep 2010 at 9:24

GoogleCodeExporter commented 9 years ago
I see a similar issue registered at the GWT project itself: 
http://code.google.com/p/google-web-toolkit/issues/detail?id=4284

Could you take a look and try the instructions mentioned overthere? Please let 
me know whether the new plugin solves this issue!

Original comment by bguijt on 3 Oct 2010 at 5:24

GoogleCodeExporter commented 9 years ago
Ok, thanks a lot. Will try and let you know.

Original comment by tech...@gmail.com on 4 Oct 2010 at 5:00

GoogleCodeExporter commented 9 years ago
@techpyx Did it work out alright?

Original comment by bguijt on 7 Oct 2010 at 3:18

GoogleCodeExporter commented 9 years ago
Unfortunately not. I tried with the latest plugin, tried debugging .... cannot 
figure it out.
My best guess right now is that this may be related to encoding somehow since 
it keeps blowing up in datastream read/write.

Original comment by tech...@gmail.com on 11 Oct 2010 at 2:17

GoogleCodeExporter commented 9 years ago
Any word on this? Tried URL.encode/decode on the item and keys but it still 
crashes

Original comment by blomqvis...@gmail.com on 17 Nov 2010 at 5:40

GoogleCodeExporter commented 9 years ago
I am basically stumped on this one, and simply no cycles at the moment to dig 
into it further.  
I work around this in dev mode by not using local storage for IE8. Btw, I meant 
encoding in the sense of character encoding like UTF-8 or other. 

Original comment by tech...@gmail.com on 21 Nov 2010 at 3:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
An official bug has been opened with the GWT team in case it is an encoding 
error: http://code.google.com/p/google-web-toolkit/issues/detail?id=5743

Original comment by j.casey....@gmail.com on 10 Dec 2010 at 4:41

GoogleCodeExporter commented 9 years ago
I see you got a comment from jat@google.com where he advises to avoid the gwt 
"this" object, and you seem to have tested that successfully.

Great!

This means we can logically solve this problem without any ugly hacks. I'll try 
this weekend!

Original comment by bguijt on 10 Dec 2010 at 1:55

GoogleCodeExporter commented 9 years ago
OK here is a patch file that I used to work around the IE8 issue. Basically I 
created JSNI wrapper classes to access localStorage and sessionStorage. I 
patched StorageImpl instead of only StorageImplIE8 because I figured that it 
was possible that another browser might also have issues with localStorage 
being accessed as a "this" object. Feel free to write your own implementation 
but I thought that I would share what I have while we wait for your fix in SVN.

Original comment by j.casey....@gmail.com on 10 Dec 2010 at 3:28

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, I notice the 'gist' of your patch. I'll keep you posted.

Original comment by bguijt on 10 Dec 2010 at 4:07

GoogleCodeExporter commented 9 years ago

Original comment by bguijt on 13 Dec 2010 at 1:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r348.

Original comment by bguijt on 9 Jan 2011 at 11:33