Re: update checkbox after asking the server
Let me simplify my question. How can I update the rows that have changed? When I delete a complete entry/row table.setVisibleRangeAndClearData(table.getVisibleRange(), true); works perfectly fine. But if the entries are not changed the checkbox is not changed back by that line of code. When I reload the page (pressing F5) all data is right again. 1. I have some rows/entries with a checkbox/boolean 2. I click it 3. A dialog opens asking me really? 4. I say no 5. The checkbox should be unchecked again Any advice? Best regards! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
update checkbox after asking the server
Hi, I have a CellTable. One of the columns is build like this ColumnMyProxy, Boolean colIsReference = new ColumnMyProxy, Boolean(new CheckboxCell()) { @Override public Boolean getValue(MyProxy rdm) { return Boolean.valueOf(rdm.isReference()); } }; colIsReference.setFieldUpdater(new FieldUpdaterMyProxy, Boolean() { public void update(final int index, final MyProxy rmd, Boolean value) { dataUpdater().setReference( rmd, value.booleanValue(), false, // don't override current reference (opens dialog if there is another reference) new Runnable() { // called if canceled public void run() { // --- Do something that unchecks the checkbox --- } } ); } }); When the user clicks the checkbox of an entry, the server checks if the value may be changed easily at the moment. If yes, I don't have a problem. If not (some other things have to be changed too) - I ask the user if he wants to change all necessary stuff. The user can click ok or cancel. If he clicks ok, I have no problem. But if the user cancels I want to uncheck the checkbox again. Whats the best way to do that? I tried to update the table with setRowData (because in my proxy in rmd the flag is still false!) and I have tried with the updateRowData of the asyncDataProvider that I use. Is there a way to bind the gui closer to my proxy? Because at the moment run() is called the proxy flag is false but the checkbox is true. Thanks in advance!! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: RequestFactory - ClassNotFound: JsonException but gwt-dev in WEB-INF/lib
Thanks a lot Thomas! Perfect hint. Much smaller and it works :) But let me dig deeper...You say: Do not ever deploy gwt-dev or gwt-user!. Because of the size (83kb vs 39mb) or is there also another reason why you say it that strict? Because I still don't see why the JSONException class was not found in the gwt-dev library. Am Donnerstag, 12. Februar 2015 11:28:55 UTC+1 schrieb Thomas Broyer: Do not ever deploy gwt-dev or gwt-user! There's a gwt-servlet.jar for that, and a gwt-servlet-deps.jar including its dependencies, for those who don't use managed dependencies (through Maven, Gradle, Ivy, etc.) On Thursday, February 12, 2015 at 12:51:47 AM UTC+1, andymel wrote: Hi, I get the following exception when I try to run my compiled gwt project with a tomcat server: Feb 12, 2015 12:34:03 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [requestFactoryServlet] in context with path [/gwtproj] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: org.json.JSONException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556) at com.google.web.bindery.autobean.shared.impl.StringQuoter.split(StringQuoter.java:73) at com.google.web.bindery.autobean.shared.AutoBeanCodex.decode(AutoBeanCodex.java:54) at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:132) at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) I added the gwt-dev.jar in the WEB-INF/lib directory after I got that exception the first time and I can see it in the lib folder on the server. But the Exception is still thrown. The app starts and can be used, but when it comes to the first usage of the requestfactory the exception is thrown. I have undeployed/recompiled/deployed the app multiple time now. Any idea? Thanks! Andy -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
RequestFactory - ClassNotFound: JsonException but gwt-dev in WEB-INF/lib
Hi, I get the following exception when I try to run my compiled gwt project with a tomcat server: Feb 12, 2015 12:34:03 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [requestFactoryServlet] in context with path [/gwtproj] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: org.json.JSONException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556) at com.google.web.bindery.autobean.shared.impl.StringQuoter.split(StringQuoter.java:73) at com.google.web.bindery.autobean.shared.AutoBeanCodex.decode(AutoBeanCodex.java:54) at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:132) at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) I added the gwt-dev.jar in the WEB-INF/lib directory after I got that exception the first time and I can see it in the lib folder on the server. But the Exception is still thrown. The app starts and can be used, but when it comes to the first usage of the requestfactory the exception is thrown. I have undeployed/recompiled/deployed the app multiple time now. Any idea? Thanks! Andy -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
RequestFactory - ValueProxy is null
Hi, I have written a small program to test the RequestFactory. I have a TestEntity class and a TestValue class on the server and corresponding TestEntityProxy and TestValueProxy on the client. public class TestEntity { private static long staticIDpool = 0; private Long id; private String testString; private TestValue testValue; public TestEntity() { super(); id = Long.valueOf(staticIDpool++); } public Long getId() { return id; } public String getTestString() { return testString; } public void setTestString(String testValue1) { this.testString = testValue1; } public TestValue getTestValue() { return testValue; } public boolean setTestValue(TestValue testValue) { this.testValue = testValue; return true; } @Override public String toString() { return Entity [+testString+, +testValue+]; } } public class TestValue { private String s1; public TestValue() { s1 = default1 (set on server); } public String getS1() { return s1; } public boolean setS1(String s) { this.s1 = s; return true; } @Override public String toString() { return TestValue [+s1+]; } } The proxies @ProxyFor(value = TestEntity.class, locator = EntityLocator.class) public interface TestEntityProxy extends EntityProxy { String getTestString(); TestValueProxy getTestValue(); } @ProxyFor(TestValue.class) public interface TestValueProxy extends ValueProxy { String getS1(); } The EntityDAO and Locators public class EntityDAO { private final static Logger LOG = Logger.getLogger(); private static EntityDAO singletonInst; private EntityDAO(){} // use getInstance() to get the singleton instance public static EntityDAO getInstance(){ if(singletonInst==null)singletonInst = new EntityDAO(); return singletonInst; } public TestEntity createDefaultTestEntity(){ LOG.info(server createDefaultTestEntity()); TestValue v = new TestValue(); v.setS1(testVALString (set on server)); TestEntity e = new TestEntity();//v, teststring set on server); e.setTestString(teststring set on server); e.setTestValue(v); LOG.info(server created! +e); return e; } } public class EntityLocator extends LocatorTestEntity, Long { @Override public TestEntity create(Class? extends TestEntity clazz) { return EntityDAO.getInstance().createDefaultTestEntity(); } @Override public TestEntity find(Class? extends TestEntity clazz, Long id) { return null; } @Override public ClassTestEntity getDomainType() { return TestEntity.class; } @Override public Long getId(TestEntity domainObject) { return domainObject.getId(); } @Override public ClassLong getIdType() { return Long.class; } @Override public Object getVersion(TestEntity domainObject) { return null; } } public class EntityDaoLocator implements ServiceLocator { public Object getInstance(Class? clazz) { return EntityDAO.getInstance(); } } My RequestFactory public interface TestRequestFactory extends RequestFactory { @Service(value = EntityDAO.class, locator = EntityDaoLocator.class) public interface EntityRequestContext extends RequestContext{ RequestTestEntityProxy createDefaultTestEntity(); } public EntityRequestContext getEntityRequestContext(); } And finally the entryPoint public void onModuleLoad() { TestRequestFactory requestFactory = GWT.create(TestRequestFactory.class); requestFactory.initialize(new SimpleEventBus()); requestFactory.getEntityRequestContext().createDefaultTestEntity().fire(new ReceiverTestEntityProxy() { @Override public void onSuccess(TestEntityProxy e) { TestValueProxy v = e.getTestValue(); String vs = null; if(v!=null){ vs = v.getS1(); } Window.alert(e.getTestString()+ / +vs); } @Override public void onFailure(ServerFailure error) { try{ super.onFailure(error); }catch(Exception e){ Window.alert(error.getMessage()); } } }); } The Text in the alert dialog is teststring set on server / null. So the String is transmitted to the client but the test vale set in the entity is null. On server side the toString of the entity (log message at the end of createDefaultTestEntity()) returns server created! Entity [teststring set on server, TestValue [testVALString (set on server)]] So the testValue is set in here. Please, can anybody tell me what I did wrong. Cause at the moment I can't see the difference to the tutorials I read. Thanks alot!! Andy -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: RequestFactory - ValueProxy is null
Jens, it works! Thanks a lot for this brief and great answer! Am Donnerstag, 22. Januar 2015 19:08:22 UTC+1 schrieb Jens: From the official GWT documentation: When querying the server, RequestFactory does not automatically populate relations in the object graph. To do this, use the with() method on a request and specify the related property name as a String: RequestPerson findReq = requestFactory.personRequest().find(personId).with(address); It is also necessary to use the with() method to retrieve any properties with types extending ValueProxy. The with() method takes multiple String arguments, so you can specify multiple property names at once. To specify nested properties, use dot notation. Putting it all together, you might have RequestPerson findReq = find(personId).with(phone,address.city,address.zip) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: efficiently push data
Thanks again for your answer Peter! ok, I think I'll do it by myself over websockets. Andy Am Donnerstag, 11. Dezember 2014 20:51:08 UTC+1 schrieb Peter Donald: Hi, ... Names I read when searching for gwt and server push or synchronization between server and client are for example: - gwteventservice - RequestFactory - gwt-comet - Atmosphere - Jboss Errai From that list I would suggest Errai as being the best candidate but I have not actually used it while the others I have investigated and found that they didn't work for one reason or another.. In short: A framework where I can register a list of Pojos on server side and have the corresponding list on client side to work with including the possibility to listen for changes on client side. Is there something coming close? Of course it would be great if the framework is doing something fancy to minimize the necessary traffic too. But the transparent event and data exchange is more important than that. However to be honest I think if I was in your scenario I would simply create simple json messages on the server and explicitly send them to the clients. I would typically do this over websockets if supported by the browser, otherwise use long polling. I have attached a response I made to a similar question that may help you. On Fri, Nov 7, 2014 at 7:08 AM, Peter Donald pe...@realityforge.org javascript: wrote: Hi, On Thu, Nov 6, 2014 at 12:07 AM, Marcel K marcel...@gmail.com javascript: wrote: Which framework for Server Push do you recommend, since Atmosphere doesn't seem to work with GWT 2.7.0? It sort of depends on your environment and what your underlying platform supports. Below is a response I made to another similar question on the mailing list. In short if you can use latest JEE or jersey then I would recommend that you use * built-in web sockets ( https://github.com/realityforge/gwt-websockets-example/blob/master/src/main/java/org/realityforge/gwt/websockets/example/server/ChatServer.java ) * addon support for EventSource/ServerSent events ( https://github.com/realityforge/gwt-eventsource-example/blob/master/src/main/java/org/realityforge/gwt/eventsource/example/server/ ) * Servlet 3 async services for long polling ( https://github.com/realityforge/gwt-webpoller-example/tree/master/src/main/java/org/realityforge/gwt/webpoller/example/server ) We use all three in our server push apps with GWT clients. HTH On Fri, Oct 31, 2014 at 5:22 AM, Peter Donald pe...@realityforge.org javascript: wrote: Hi, We have built several systems like this where we want to push data to clients from the server. The client is responsible for subscribing to a channel possibly with filters in place. Rather than use GWT-RPC we have tended to move to using raw messages that are typically json blobs. We have used 4 basic strategies depending on the clients supported and the application requirements. The strategies are; 1. WebSockets 2. Server-Sent Events 3. Long polling 4. Periodic Polling I had a poke around and found a good stack overflow answer to this (See [1]) When we faced the same issues, we ended up putting together a couple of libraries to help with in GWT. * websockets: https://github.com/realityforge/gwt-websockets * Server-sent Events: https://github.com/realityforge/gwt-eventsource * Polling: https://github.com/realityforge/gwt-webpoller (Warning this API is not yet at 1.0 status) The tricky part is actually managing the channels and messages sequencing in each channel but we never got arounf to releasing our code for that part of the problem. HTH [1] http://stackoverflow.com/questions/11077857/what-are-long-polling-websockets-server-sent-events-sse-and-comet -- Cheers, Peter Donald On Fri, Dec 12, 2014 at 2:12 AM, andymel sound...@gmail.com javascript: wrote: HI Peter, thank you very much for taking the time to write this very interesting post! Especially the 'delta-hierarchy'-graphs and the TransactionRegistry will inspire me if I have to implement it by myself. But my main hope was that someone could point me to something that handles the synchronization between server and client for me. More about my context: My server doesn't use any persistence framework. Different clients connect and stream byte data to my server directly to disk. During the stream I extract meta data. When the client ends the stream the metadata is saved as file to the streamed data on disk. The browser gui is used to browse and work with this data in different ways and should be updated automatically when new streams arrive. During my research I found a list of libraries that seem to be meant to solve the synchronization between server and gwt-client side objects. Names I read when searching for gwt and server push or synchronization between server and client are for example
Re: efficiently push data
HI Peter, thank you very much for taking the time to write this very interesting post! Especially the 'delta-hierarchy'-graphs and the TransactionRegistry will inspire me if I have to implement it by myself. But my main hope was that someone could point me to something that handles the synchronization between server and client for me. More about my context: My server doesn't use any persistence framework. Different clients connect and stream byte data to my server directly to disk. During the stream I extract meta data. When the client ends the stream the metadata is saved as file to the streamed data on disk. The browser gui is used to browse and work with this data in different ways and should be updated automatically when new streams arrive. During my research I found a list of libraries that seem to be meant to solve the synchronization between server and gwt-client side objects. Names I read when searching for gwt and server push or synchronization between server and client are for example: - gwteventservice - RequestFactory - gwt-comet - Atmosphere - Jboss Errai As there is no time to try everything and find all pro and cons before I decide my best case scenario would be if someone could point me in the right direction after I write down what is needed. In short: A framework where I can register a list of Pojos on server side and have the corresponding list on client side to work with including the possibility to listen for changes on client side. Is there something coming close? Of course it would be great if the framework is doing something fancy to minimize the necessary traffic too. But the transparent event and data exchange is more important than that. Only if nothing fits I will implement it by myself. Thanks Peter once again for adding a great answer for that exit scenario. Andy Am Donnerstag, 11. Dezember 2014 01:49:00 UTC+1 schrieb Peter Donald: Hi, So we have several applications where we follow a similar pattern. We use java EE but any framework that allows you to intercept your business services and supports JPA EntityListener's should be capable of directly implementing this. Our EntityListener implementation has a @PostPersist, @PostUpdate and @PreRemove that captures the delta of the jpa entity. These deltas are stored in TransactionSynchronizationRegistry. We need to use the registry rather than thread locals to deal with EJBs that are run in separate threads. Then we add an interceptor on our business services and the boundary/very first service that is invoked by the client is responsible for collecting all the changes out of the TransactionSynchronizationRegistry and routing them to interested clients. The clients then receive the deltas and apply them to their local model. The changes are packaged up into one message per transaction, which ensures the client-side state is always consistent. The content based routing is the hard part. Clients subscribe to graphs. Typically we define graphs that have a single root entity. When an entity delta is routed we allocate it to 0 or more graphs. Then the graphs determine which clients the delta is routed to. Then the deltas are aggregated into a single message for each client. Imagine a domain model as simple as the following. class Company { int id: String name; } class Person { int id: String name; Company company; Person reportsTo; } And there is two possible subscriptions. You can either subscribe to a Company and receive all changes for a company or you can subscribe to a person and all the direct reports. So if we imagine data like Company {1, Bobs Bobcats} Company {2, Marys Mowers} Person {1, Bob, 1, null} Person {2, Bill, 2, 1} Person {3, Mary, 2, null} So imagine a change happens to Person 2. The change would be associated with the Supervisor Graph rooted at Person 1 and it would be associated with the Company Graph rooted at Company 1. If a change happens to Person 3. The change would be associated with the Company Graph rooted at Company 2. The changes are pushed out to the clients based on a combination of long polling, server-sent events and websockets. Of course this is quite complicated so we have a DSL that generates the majority of this with a couple of extensions points where developers can write routing code etc. Mostly this means have fairly complex apps with up to 80 entities that are replicated to the client with most developers being completely unaware of how it works and being able to write simple code paths. The UI developers only care about receiving changes and reflect them on the UI, the server side developers just write simple state transform code, the network layer is extremely efficient and it is trivial to build multi-client interactive applications. HTH On Wed, Dec 10, 2014 at 4:27 AM, andymel sound...@gmail.com javascript: wrote: Hi, I think about
efficiently push data
Hi, I think about how to implement a *browser GUI that primarily will show a list of a lot of data objects*. When something is added to the list on server side or one of those objects is changed, the client side *GUI should be updated*. So I need a *server push*. I already have a websocket connection and used the AutoBean functionality for something else. In theory I could immediately implement the whole thing by either pushing the whole list each time something is changed or even do any suitable caching. But I'm relatively new to GWT and I'm sure there are a lot of things that I don't know yet. I'm curious* how people with more experience would implement it*. During my research today I discovered the RequestFactory where caching seems to be included. At least I found the sentence *Furthermore, the EntityProxy interface enables RequestFactory to compute and send only changes (deltas) to the server.* Can this be used to have a List/Result entity on the server and client that is updated automatically with just a little bit of traffic in between without thinking about what was changed by myself? Do you recommend anything else for this use case? Thanks in advance! Andy -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Websockets using GWT - Best practice
Hi, I'm currently trying to establish a websocket connection in GWT 2.6 and 2.7 using gwt-ws. *My question:* the Google search points me to the gwt-ws project to implement websocket connections. But the code examples there do not work with the jetty version included in GWT 2.6 and 2.7 Is there a best practice to do it know? Any known code examples you can point me to? *More infos about the problem:* The server (coded as shown at Getting Started https://code.google.com/p/gwt-ws/)throws an AbstractMethodExeption. Here is the full StackTrace java.lang.AbstractMethodError: de.csenk.gwt.ws.server.jetty. JettyWebSocketConnection.onOpen(Lorg/eclipse/jetty/websocket/ WebSocket$Connection;)V at org.eclipse.jetty.websocket.WebSocketConnectionRFC6455.onWebSocketOpen( WebSocketConnectionRFC6455.java:425) at org.eclipse.jetty.websocket.WebSocketServletConnectionRFC6455.handshake( WebSocketServletConnectionRFC6455.java:60) at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory. java:323) at org.eclipse.jetty.websocket.WebSocketFactory.acceptWebSocket( WebSocketFactory.java:396) at org.eclipse.jetty.websocket.WebSocketServlet.service(WebSocketServlet. java:104) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java: 501) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java :137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java: 557) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler. java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler. java:1086) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428 ) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler. java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler. java:1020) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java :135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper. java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest( AbstractHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete( AbstractHttpConnection.java:949) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler. headerComplete(AbstractHttpConnection.java:1011) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection. java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle( SelectChannelEndPoint.java:668) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run( SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool. java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool. java:543) at java.lang.Thread.run(Thread.java:744) Seems like the onOpen() method was added in the WebSocket interface The implementation de.csenk.gwt.ws.server.jetty.JettyWebSocketConnection seems to implement an older WebSocket interface without onOpen method. thanks in advance!! Andy -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Trying to get an object with a number array out of a js script
Hi, *I tried to post this here a week before, but for whatever reason I posted it in another group...Now, after waiting one week for the post to be activated by a moderator I found it with a google search in another group (GWT Contributors). Maybe it was wrongly attached by a moderator to that other group?!? Doesn't matter. I only write it down in case that happens again. * *I got an answer that my function TestObj.member1 has to return 'this'. I'm still new to JavaScript but I think a call of new TestObj.member1 should return the object that is created?!Here is the original posting. I hope it works now...thanks a lot!!:* I am trying to find a bug in my first gwt project. I wrote another little project with just 3 classes to show just the behavior I don't understand. I try to initialize objects in JavaScript (need that to use an existing js script in my (new) Java Code). For my test I simply want to get an Object with a number array and read that...but the call of get(i) leads to 'Something other than a double was returned from JSNI method'. Can anybody point me in the right direction please!? Thanks a lot!! :) JavaScript: var TestObj = {}; /* helper function to get such an object * not possible to get it directly?!*/ function getMem1(x,y){ return new TestObj.member1([x,y]); } TestObj.member1 = function(p){ // should be an array of two floating point values (saved as double in java) this.p = p; } My Java Object: public class TestObjJava { private double x; private double y; public TestObjJava(double x, double y) { this.x = x; this.y = y; } public native TestObjJS getAsJSObj() /*-{ return $wnd.getMem1(this.x, this.y) }-*/; } My JavaScriptObject public class TestObjJS extends JavaScriptObject { protected TestObjJS() {} public final native JsArrayNumber getP() /*-{ return this.p; }-*/; } The code that leads to the error: public void onModuleLoad() { TestObjJava jObj = new TestObjJava(12, 23); TestObjJS jsObj = jObj.getAsJSObj(); JsArrayNumber p = jsObj.getP(); System.out.println(p); for(int i=0; ip.length(); i++){ System.out.println(i+: +p.get(i)); } } The full error message: onModuleLoad() threw an exception Exception while loading module andymel.tests.gwttests.client.GWTTests. See Development Mode for details. java.lang.reflect.InvocationTargetException 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.ModuleSpace.onLoad(ModuleSpace.java:411) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Unknown Source) Caused by: com.google.gwt.dev.shell.HostedModeException: Something other than a double was returned from JSNI method '@com.google.gwt.core.client.JsArrayNumber::get(I)': JS value of type undefined, expected double at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:112) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeDouble(ModuleSpace.java:238) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeDouble(JavaScriptHost.java:59) at com.google.gwt.core.client.JsArrayNumber$.get$(JsArrayNumber.java) at andymel.tests.gwttests.client.GWTTests.onModuleLoad(GWTTests.java:30) ... 9 more -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
[gwt-contrib] JsArrayNumber::get(I)': JS value of type undefined, expected double
Hi, I am trying to find a bug in my first gwt project. I wrote another little project with just 3 classes to show just the behavior I don't understand. I try to initialize objects in JavaScript (need that to use an existing js script in my (new) Java Code). For my test I simply want to get an Object with a number array and read that...but the call of get(i) leads to 'Something other than a double was returned from JSNI method'. Can anybody point me in the right direction please!? Thanks a lot!! :) JavaScript: var TestObj = {}; /* helper function to get such an object * not possible to get it directly?!*/ function getMem1(x,y){ return new TestObj.member1([x,y]); } TestObj.member1 = function(p){ // should be an array of two floating point values (saved as double in java) this.p = p; } My Java Object: public class TestObjJava { private double x; private double y; public TestObjJava(double x, double y) { this.x = x; this.y = y; } public native TestObjJS getAsJSObj() /*-{ return $wnd.getMem1(this.x, this.y) }-*/; } My JavaScriptObject public class TestObjJS extends JavaScriptObject { protected TestObjJS() {} public final native JsArrayNumber getP() /*-{ return this.p; }-*/; } The code that leads to the error: public void onModuleLoad() { TestObjJava jObj = new TestObjJava(12, 23); TestObjJS jsObj = jObj.getAsJSObj(); JsArrayNumber p = jsObj.getP(); System.out.println(p); for(int i=0; ip.length(); i++){ System.out.println(i+: +p.get(i)); } } The full error message: onModuleLoad() threw an exception Exception while loading module andymel.tests.gwttests.client.GWTTests. See Development Mode for details. java.lang.reflect.InvocationTargetException 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.ModuleSpace.onLoad(ModuleSpace.java:411) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) at java.lang.Thread.run(Unknown Source) Caused by: com.google.gwt.dev.shell.HostedModeException: Something other than a double was returned from JSNI method '@com.google.gwt.core.client.JsArrayNumber::get(I)': JS value of type undefined, expected double at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:112) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeDouble(ModuleSpace.java:238) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeDouble(JavaScriptHost.java:59) at com.google.gwt.core.client.JsArrayNumber$.get$(JsArrayNumber.java) at andymel.tests.gwttests.client.GWTTests.onModuleLoad(GWTTests.java:30) ... 9 more -- You received this message because you are subscribed to the Google Groups GWT Contributors group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/e3383695-7f7f-46f1-b346-25f2dcc338e3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.