Cool - good to know single origin policy doesn't get you. I have no idea about that bug. According to one of my colleagues, thats happening because the client isn't getting the snapshot before it starts getting operations. I don't know why its happening; I've never seen it before.
We're going to replace some of that code soon anyway, so its not high on the 'things to fix' list. -J On Wed, Sep 29, 2010 at 10:13 AM, Thomas Wrobel <[email protected]> wrote: > Bingo! > /socket was all I needed *slaps forehead* > Ok, its connecting now, and retrieves the wave list ok. > Thanks a bunch. > (and good to know how to monitor my web-socket traffic too, that will be > usefull in future) > However, now I'm getting an error logged when I try to click a wave; > ed Sep 29 02:10:52 CEST 2010[SEVERE] Unhandled exception Received deltas > with no stacklet present! > org.waveprotocol.wave.concurrencycontrol.channel.OperationChannelMultiplexerImpl$3.onUpdate > (OperationChannelMultiplexerImpl.java:596) > org.waveprotocol.wave.concurrencycontrol.channel.ViewChannelImpl.onUpdate > (ViewChannelImpl.java:331) > org.waveprotocol.wave.examples.client.webclient.waveclient.common.WaveViewServiceImpl.publishDeltaList > (WaveViewServiceImpl.java:297) > org.waveprotocol.wave.examples.client.webclient.waveclient.common.WebClientBackend.receiveWaveletUpdate > (WebClientBackend.java:337) > org.waveprotocol.wave.examples.client.webclient.client.WebClient$3.handleWaveletUpdate > (WebClient.java:120) > org.waveprotocol.wave.examples.client.webclient.client.WaveWebSocketClient$2.onMessage > (WaveWebSocketClient.java:93) > com.google.gwt.websockets.client.WebSocket.onMessage (WebSocket.java:94) > sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2) > sun.reflect.NativeMethodAccessorImpl.invoke (null:-1) > sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1) > java.lang.reflect.Method.invoke (null:-1) > com.google.gwt.dev.shell.MethodAdaptor.invoke (MethodAdaptor.java:103) > com.google.gwt.dev.shell.MethodDispatch.invoke (MethodDispatch.java:71) > com.google.gwt.dev.shell.OophmSessionHandler.invoke > (OophmSessionHandler.java:154) > com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn > (BrowserChannelServer.java:336) > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript > (BrowserChannelServer.java:217) > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke > (ModuleSpaceOOPHM.java:120) > com.google.gwt.dev.shell.ModuleSpace.invokeNative (ModuleSpace.java:510) > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject > (ModuleSpace.java:264) > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject > (JavaScriptHost.java:91) com.google.gwt.core.client.impl.Impl.apply > (Impl.java:-1) com.google.gwt.core.client.impl.Impl.entry0 (Impl.java:214) > sun.reflect.GeneratedMethodAccessor32.invoke (null:-1) > sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1) > java.lang.reflect.Method.invoke (null:-1) > com.google.gwt.dev.shell.MethodAdaptor.invoke (MethodAdaptor.java:103) > com.google.gwt.dev.shell.MethodDispatch.invoke (MethodDispatch.java:71) > com.google.gwt.dev.shell.OophmSessionHandler.invoke > (OophmSessionHandler.java:154) > com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages > (BrowserChannelServer.java:291) > com.google.gwt.dev.shell.BrowserChannelServer.processConnection > (BrowserChannelServer.java:541) > com.google.gwt.dev.shell.BrowserChannelServer.run > (BrowserChannelServer.java:362) java.lang.Thread.run (null:-1) > (No blips appear) > > > On 29 September 2010 01:27, Joseph Gentle <[email protected]> wrote: >> >> A single packet doesn't mean much, unfortunately. >> >> Right-click on that packet you found. One of the options is 'Follow >> TCP stream' or something like that. A new box will come up which shows >> the full TCP stream. There are buttons down the bottom of the window >> to switch it to ascii mode. Paste in a copy of that. >> >> It looks like maybe the client is trying to connect via websockets to >> '/' as opposed to '/socket', which is the correct URL. I'm going to >> guess that you've changed line 182 in WebClient.java from this: >> websocket.connect(getWebSocketBaseUrl(GWT.getModuleBaseURL()) + "socket"); >> ... to something like this: >> websocket.connect("ws://my-server:9898/"); >> ... when actually it should be this: >> websocket.connect("ws://my-server:9898/socket"); >> >> If thats not the case, can you add this line: >> LOG.info("Connecting to websocket URL: " + url); >> to >> src/org/waveprotocol/wave/examples/client/webclient/client/WaveWebSocketClient.java >> line 108, recompile the GWT app, force your browser to reload and tell >> me what the log spits out as the websocket url? >> >> Cheers >> Joseph >> >> On Wed, Sep 29, 2010 at 8:39 AM, Thomas Wrobel <[email protected]> >> wrote: >> > Ok, I tried that software and I -think- I'm doing the right thing. Set >> > it to >> > only capture things on 9898, then looked at things going from my IP once >> > the >> > webclient was trying to connect. >> > This seemed to be the result; >> > 0000 00 24 8c bc 0c 34 00 16 e6 85 e9 95 08 00 45 00 .$...4.. >> > ......E. >> > 0010 01 05 25 3c 40 00 80 06 ee fd c0 a8 b2 36 c0 a8 ..%<@... >> > .....6.. >> > 0020 b2 31 05 10 26 aa 18 93 8d 8b 13 9f 48 77 50 18 .1..&... >> > ....HwP. >> > 0030 80 00 77 68 00 00 47 45 54 20 2f 20 48 54 54 50 ..wh..GE T / >> > HTTP >> > 0040 2f 31 2e 31 0d 0a 55 70 67 72 61 64 65 3a 20 57 /1.1..Up grade: >> > W >> > 0050 65 62 53 6f 63 6b 65 74 0d 0a 43 6f 6e 6e 65 63 ebSocket >> > ..Connec >> > 0060 74 69 6f 6e 3a 20 55 70 67 72 61 64 65 0d 0a 48 tion: Up >> > grade..H >> > 0070 6f 73 74 3a 20 31 39 32 2e 31 36 38 2e 31 37 38 ost: 192 >> > .168.178 >> > 0080 2e 34 39 3a 39 38 39 38 0d 0a 4f 72 69 67 69 6e .49:9898 >> > ..Origin >> > 0090 3a 20 68 74 74 70 3a 2f 2f 31 32 37 2e 30 2e 30 : http:/ >> > /127.0.0 >> > 00a0 2e 31 3a 31 32 33 34 0d 0a 53 65 63 2d 57 65 62 .1:1234. >> > .Sec-Web >> > 00b0 53 6f 63 6b 65 74 2d 4b 65 79 31 3a 20 31 2b 38 Socket-K ey1: >> > 1+8 >> > 00c0 37 20 32 6b 38 37 32 20 31 20 20 20 20 20 6c 36 7 2k872 1 >> > l6 >> > 00d0 32 0d 0a 53 65 63 2d 57 65 62 53 6f 63 6b 65 74 2..Sec-W >> > ebSocket >> > 00e0 2d 4b 65 79 32 3a 20 32 3c 49 20 20 6f 20 20 4a -Key2: 2 <I o >> > J >> > 00f0 20 39 20 32 35 45 20 35 58 20 31 6f 34 20 35 20 9 25E 5 X 1o4 >> > 5 >> > 0100 20 34 20 38 44 2f 2a 0d 0a 0d 0a b4 1e 60 94 62 4 8D/*. >> > .....`.b >> > 0110 77 d4 77 w.w >> > Does that mean anything to anyone? Sorry about having the hex-view >> > there >> > too, I dont know how to set the software to output just the text view. >> > >> > On 28 September 2010 14:14, Dave butlerdi <[email protected]> wrote: >> >> >> >> You can download Wireshark from http://www.wireshark.org/ and see all >> >> your >> >> messages. >> >> >> >> On 28 September 2010 14:10, Thomas Wrobel <[email protected]> wrote: >> >>> >> >>> Ok, so I can ignore the compile errors as they have nothing to do with >> >>> the server not connecting. >> >>> I added a few more log lines to try to debug. >> >>> After a "Warning:Session not available" message, the webclient seems >> >>> to >> >>> get as far as the; >> >>> >> >>> " public static native WebSocketImpl create(WebSocket client, String >> >>> server) >> >>> /*-{ >> >>> console.warn("creating websocket "); >> >>> var ws = new WebSocket(server); ............" >> >>> >> >>> But then I get a "unexpected response" in the console; >> >>> creating websocket >> >>> :1234Unexpected response code: 200 >> >>> And the server is getting this exception; >> >>> HttpException(400,null,null) >> >>> at >> >>> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:360) >> >>> at >> >>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:211) >> >>> at >> >>> >> >>> org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) >> >>> at >> >>> >> >>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:506) >> >>> at >> >>> >> >>> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) >> >>> at java.lang.Thread.run(Thread.java:619) >> >>> >> >>> I'm not sure how to proceed to debug this further. (Is there a way to >> >>> see >> >>> what "new WebSocket(server);" is broadcasting out?) >> >>> ======== >> >>> Regarding websockets; >> >>> I was not aware same-origin policy applied to websockets - I really >> >>> need >> >>> to be able to run the server on a different machine >> >>> to the client, so is there some way to specify an IP/Port as being >> >>> allowed? They are both on the same local network. (Server is >> >>> Ubuntu/Prosody, >> >>> client is just WindowsXP). >> >>> This is my first experience using websockets so I have little >> >>> knowledge >> >>> of how to set things up. (or even where to look) >> >>> >> >>> Thanks for your help, >> >>> -Thomas >> >>> >> >>> >> >>> >> >>> >> >>> On 28 September 2010 01:25, Joseph Gentle <[email protected]> wrote: >> >>>> >> >>>> Hey - I didn't know you could just right-click and go 'Compile GWT >> >>>> Application'. Thats neat. I've been using eclipse's ant plugin to >> >>>> compile the code using ant. Maybe thats the reason you had to add >> >>>> gwt.user.User to the modules - maybe our ant gwt compilation adds >> >>>> that >> >>>> through a command-line flag or something. >> >>>> >> >>>> The compile errors you're seeing are due to our gwt xml files pulling >> >>>> in some unused class files, which are missing .java source code. The >> >>>> compile still works anyway because none of those classes are actually >> >>>> used. As for the JavaWaverefEncoder thing, I actually fixed something >> >>>> else related to that class and got confused. I'm seeing that error >> >>>> during gwt compilation as well. >> >>>> >> >>>> So given that your build is succeeding, why doesn't your wave client >> >>>> work? If I had to guess, I'd say that maybe the single-origin policy >> >>>> is causing the websocket connection to fail, since you're loading the >> >>>> client locally, and its trying to open a websocket connection >> >>>> remotely? I really don't know. If you want to muck around, I >> >>>> recommend >> >>>> just running the server locally on your dev box. You can launch the >> >>>> server from eclipse by importing the project ("New java project... >> >>>> From existing source, Location: /foo/blah/wave-protocol"). Make a run >> >>>> configuration. It should look like this: >> >>>> Main class: org.waveprotocol.wave.examples.fedone.ServerMain >> >>>> Arguments: >> >>>> Program arguments: >> >>>> --client_frontend_hostname=localhost --client_frontend_port=9876 >> >>>> --wave_server_domain=example.com --xmpp_component_name=wave >> >>>> --xmpp_jid=wave.example.com --xmpp_server_description=FedOne >> >>>> --xmpp_server_hostname=example.com --xmpp_server_ip=example.com >> >>>> --xmpp_server_port=5275 --xmpp_server_secret opensesame >> >>>> --xmpp_server_ping=wavesandbox.com >> >>>> --certificate_private_key=example.com.key >> >>>> --certificate_files=example.com.crt --certificate_domain=example.com >> >>>> --waveserver_disable_verification=false >> >>>> --waveserver_disable_signer_verification=true >> >>>> --http_frontend_hostname=localhost --http_frontend_port=9898 >> >>>> --enable_federation=false --cert_path_store_type=memory >> >>>> --attachment_store_type=disk --account_store_type=memory >> >>>> >> >>>> VM arguments: >> >>>> -Dorg.eclipse.jetty.util.log.DEBUG=true >> >>>> >> >>>> ... At least, that works for me. >> >>>> >> >>>> -J >> >>>> >> >>>> >> >>>> On Tue, Sep 28, 2010 at 4:16 AM, Thomas Wrobel <[email protected]> >> >>>> wrote: >> >>>> > Yup, the webclient hosted by the webserver works just fine. >> >>>> > I wanted a go at making my own customized client though. >> >>>> > >> >>>> > It seemed, from a quick glance of the code, pretty trival to change >> >>>> > where the client looks for the server so that was the only change I >> >>>> > made. (just changing a dynamically made string by >> >>>> > "getWebSocketBaseUrl" to a hard-coded one for now). >> >>>> > I think that part is correct, as the server is getting the >> >>>> > requests, >> >>>> > they are just formated badly....which I assume is due to the other >> >>>> > compile errors. >> >>>> > >> >>>> > I do get the permutations. >> >>>> > The full compile log at the moment is; >> >>>> > =============================================================== >> >>>> > >> >>>> > I'm compiling this by right clicking on WebClient.xml and going >> >>>> > "Compile GWT Application" in eclipse. >> >>>> > >> >>>> > Strangely though, this is all from a version I checked out after >> >>>> > Friday, so it should have had your fix already in it. >> >>>> > >> >>>> > Thanks, >> >>>> > Thomas >> >>>> > >> >>>> > >> >>>> > On 27 September 2010 03:53, Joseph Gentle <[email protected]> >> >>>> > wrote: >> >>>> >> If you're running the server on another machine, just run: >> >>>> >> ant compile_gwt >> >>>> >> on the server and then when you ./run-server.sh it'll also host >> >>>> >> the >> >>>> >> web frontend as well. (Usually at http://hostname:9898/) >> >>>> >> >> >>>> >> The web frontend isn't designed to let you connect to arbitrary >> >>>> >> wave >> >>>> >> servers, it assumes you're connecting to the machine that is >> >>>> >> hosting >> >>>> >> the page. >> >>>> >> >> >>>> >> As for windows builds, all that looks troubling. I put in a change >> >>>> >> to >> >>>> >> fix the JavaWaverefEncoder error last friday. Do those errors just >> >>>> >> crop up when you're building? Does it go on to say: >> >>>> >> [java] Compiling 3 permutations >> >>>> >> [java] Compiling permutation 0... >> >>>> >> [java] Compiling permutation 1... >> >>>> >> ... etc? >> >>>> >> >> >>>> >> We really need to clean up our windows build bits. I think its a >> >>>> >> bit >> >>>> >> painful at the moment. (Or at the very least, write some docs >> >>>> >> which >> >>>> >> explain how to do it) >> >>>> >> >> >>>> >> -J >> >>>> >> >> >>>> >> >> >>>> >> On Mon, Sep 27, 2010 at 6:00 AM, ThomasWrobel >> >>>> >> <[email protected]> >> >>>> >> wrote: >> >>>> >>> I'm trying to compile the simple web client using eclipse. >> >>>> >>> I have a working wave server on another pc already, so I'm merely >> >>>> >>> trying to compile a client and connect to it. >> >>>> >>> >> >>>> >>> I got the web client from here; >> >>>> >>> >> >>>> >>> >> >>>> >>> http://code.google.com/p/wave-protocol/source/browse?repo=default#hg/src/org/waveprotocol/wave/examples/client/webclient >> >>>> >>> >> >>>> >>> And imported it into eclipse. >> >>>> >>> At first I got a few errors about "String" not being recognized >> >>>> >>> in >> >>>> >>> WebSockets,java, which were fixed by add; >> >>>> >>> >> >>>> >>> <inherits name="com.google.gwt.user.User"/> >> >>>> >>> >> >>>> >>> To some of the module.xmls. >> >>>> >>> >> >>>> >>> I also had to add a startup URL, pointing to copy of the starting >> >>>> >>> page. >> >>>> >>> With this it will compile and load in the browser (chrome) but >> >>>> >>> fails >> >>>> >>> to connect. >> >>>> >>> Giving a "attempting to reconnect" error every few seconds. >> >>>> >>> (on the server end these are producing parser errors) >> >>>> >>> >> >>>> >>> Looking at the compile logs I got; >> >>>> >>> >> >>>> >>> 21:17:03.468 [ERROR] [webclient] Errors in >> >>>> >>> 'jar:file:/C:/TomsProjects/ >> >>>> >>> SimpleWaveMapClient/tomswaveserverthing/third_party/runtime/wave- >> >>>> >>> libraries/common-src.jar!/org/waveprotocol/wave/common/util/ >> >>>> >>> JavaWaverefEncoder.java' >> >>>> >>> >> >>>> >>> 21:17:03.484 [ERROR] [webclient] Line 20: The import java.net >> >>>> >>> cannot >> >>>> >>> be resolved >> >>>> >>> >> >>>> >>> 21:17:03.546 [ERROR] [webclient] Line 43: URLDecoder cannot be >> >>>> >>> resolved >> >>>> >>> >> >>>> >>> and >> >>>> >>> >> >>>> >>> 21:17:03.718 [ERROR] [webclient] Errors in >> >>>> >>> 'jar:file:/C:/TomsProjects/ >> >>>> >>> SimpleWaveMapClient/tomswaveserverthing/third_party/runtime/wave- >> >>>> >>> libraries/model-src.jar!/org/waveprotocol/wave/model/schema/impl/ >> >>>> >>> UserDataSchemas.java' >> >>>> >>> >> >>>> >>> 21:17:03.734 [ERROR] [webclient] Line 65: No source code is >> >>>> >>> available >> >>>> >>> for type >> >>>> >>> org.waveprotocol.wave.model.supplement.WaveletBasedSupplement; >> >>>> >>> did >> >>>> >>> you >> >>>> >>> forget to inherit a required module? >> >>>> >>> >> >>>> >>> 21:17:03.750 [ERROR] [webclient] Line 209: No source code is >> >>>> >>> available >> >>>> >>> for type >> >>>> >>> >> >>>> >>> org.waveprotocol.wave.model.supplement.DocumentBasedAbuseStore<N,E>; >> >>>> >>> did you forget to inherit a required module? >> >>>> >>> >> >>>> >>> >> >>>> >>> errors. >> >>>> >>> I read around the group and it seems some errors are expected >> >>>> >>> when >> >>>> >>> compiling, but I dont think these ones are and the URLDecoder >> >>>> >>> could >> >>>> >>> be >> >>>> >>> the source of my error? >> >>>> >>> any ideas? >> >>>> >>> >> >>>> >>> -- >> >>>> >>> You received this message because you are subscribed to the >> >>>> >>> Google >> >>>> >>> Groups "Wave Protocol" group. >> >>>> >>> To post to this group, send email to >> >>>> >>> [email protected]. >> >>>> >>> To unsubscribe from this group, send email to >> >>>> >>> [email protected]. >> >>>> >>> For more options, visit this group at >> >>>> >>> http://groups.google.com/group/wave-protocol?hl=en. >> >>>> >>> >> >>>> >>> >> >>>> >> >> >>>> >> -- >> >>>> >> You received this message because you are subscribed to the Google >> >>>> >> Groups "Wave Protocol" group. >> >>>> >> To post to this group, send email to >> >>>> >> [email protected]. >> >>>> >> To unsubscribe from this group, send email to >> >>>> >> [email protected]. >> >>>> >> For more options, visit this group at >> >>>> >> http://groups.google.com/group/wave-protocol?hl=en. >> >>>> >> >> >>>> >> >> >>>> > >> >>>> > -- >> >>>> > You received this message because you are subscribed to the Google >> >>>> > Groups "Wave Protocol" group. >> >>>> > To post to this group, send email to >> >>>> > [email protected]. >> >>>> > To unsubscribe from this group, send email to >> >>>> > [email protected]. >> >>>> > For more options, visit this group at >> >>>> > http://groups.google.com/group/wave-protocol?hl=en. >> >>>> > >> >>>> > >> >>>> >> >>>> -- >> >>>> You received this message because you are subscribed to the Google >> >>>> Groups "Wave Protocol" group. >> >>>> To post to this group, send email to [email protected]. >> >>>> To unsubscribe from this group, send email to >> >>>> [email protected]. >> >>>> For more options, visit this group at >> >>>> http://groups.google.com/group/wave-protocol?hl=en. >> >>>> >> >>> >> >>> -- >> >>> You received this message because you are subscribed to the Google >> >>> Groups >> >>> "Wave Protocol" group. >> >>> To post to this group, send email to [email protected]. >> >>> To unsubscribe from this group, send email to >> >>> [email protected]. >> >>> For more options, visit this group at >> >>> http://groups.google.com/group/wave-protocol?hl=en. >> >> >> >> >> >> >> >> -- >> >> Regards >> >> >> >> Dave Butler >> >> butlerdi-at-pharm2phork-dot-org >> >> >> >> Also on Skype as pharm2phork >> >> >> >> Get Skype here http://www.skype.com/download.html >> >> >> >> >> >> ********************************************************************** >> >> This email and any files transmitted with it are confidential and >> >> intended solely for the use of the individual or entity to whom they >> >> are addressed. If you have received this email in error please notify >> >> the system manager. >> >> >> >> This footnote also confirms that this email message has been swept by >> >> MIMEsweeper for the presence of computer viruses. >> >> >> >> www.mimesweeper.com >> >> ********************************************************************** >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups >> >> "Wave Protocol" group. >> >> To post to this group, send email to [email protected]. >> >> To unsubscribe from this group, send email to >> >> [email protected]. >> >> For more options, visit this group at >> >> http://groups.google.com/group/wave-protocol?hl=en. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Wave Protocol" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group at >> > http://groups.google.com/group/wave-protocol?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Wave Protocol" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/wave-protocol?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Wave Protocol" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/wave-protocol?hl=en. > -- You received this message because you are subscribed to the Google Groups "Wave Protocol" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/wave-protocol?hl=en.
