Re: SerializationException when application is modified

2017-07-20 Thread Óscar Frías Barranco
Hi.

Thanks a lot for you all your replies.  We have just noticed that the
behavior of the RPC calls is different depending on whether the beans
travelling through the wire implement Serializable or IsSerializable.

When they implement IsSerializable the onFailure(Throwable) method of the
AsyncCallback contains a IncompatibleRemoteServiceException.  According to
its Javadoc "The correct response to receiving an instance of this
exception in the AsyncCallback.onFailure(Throwable) method is to get the
application into a state where a browser refresh can be done."

On the other side, when they implement the generic Serializable method, the
exception is the more generic StatusCodeException with a message "500 The
call failed on the server; see server log for details".  This is too
generic, it could be caused by any problems on the server, not just code
changes requiring a reload.

So it looks like its better to implement IsSerializable rather than
Serializable.

What do you think?  Am I missing something?


On Wed, Jul 19, 2017 at 12:22 PM, Thomas Broyer  wrote:

>
>
> On Tuesday, July 18, 2017 at 6:15:23 PM UTC+2, Óscar Frías Barranco wrote:
>>
>> Hi.
>>
>> When we modify the code of our GWT application, in particular the classes
>> that travel through GWT calls, these exceptions are generated for many
>> users for a few hours:
>>
>> com.google.gwt.user.client.rpc.SerializationException: Type '.' was
>> not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and
>> did not have a custom field serializer.For security purposes, this type
>> will not be serialized.: instance = .
>>
>> We think that this is due to browsers caching the previous (old) code
>> which is no longer aligned with the server code.  We have reviewed all HTTP
>> headers related to caching and all of the are, we think, correctly
>> configured.
>>
>> So our plan is to force a reload of the browser page with a
>> location.reload(true) when we detect that the SerializationException is
>> being thrown at the server.
>>
>
> From a UX point of view, it's probably better to show an error (possibly
> with a button to reload the app) than forcibly reload, as that could
> possibly lead to losing data the user has entered.
> This is what Google Groups is doing, and it allows users to copy their
> message before reloading, pasting and re-sending it.
>
>
>> Any ideas about how to implement this easily?  Our code if full of
>> AsyncCallback calls and we would like to avoid editing each one of them.
>> Is there a place where we could insert a client code that would be executed
>> for every RPC call and that will call location.reload(true) if a
>> SerializationException is thrown ?
>>
>
> If your GWT.create() for the services are relatively centralized, you
> could implement wrappers that wrap the AsyncCallback before delegating to
> the real service.
>
> I.e. from
>
> FooServiceAsync fooService = GWT.create(FooService.class);
>
> to
>
> FooServiceAsync fooService = new FooServiceAsyncWrapper();
>
> with
>
> class FooServiceAsyncWrapper implements FooServiceAsync {
>   private final FooServiceAsync delegate = GWT.create(FooService.class);
>
>   @Override
>   public void doFoo(int param1, String param2, AsyncCallback
> callback) {
> delegate.doFoo(param1, param2, new AsyncCallbackWrapper(
> callback));
>   }
> }
>
> class AsyncCallbackWrapper implements AsyncCallback {
>   private final AsyncCallback delegate;
>
>   public AsyncCallbackWrapper(AsyncCallback delegate) {
> this.delegate = delegate;
>   }
>
>   @Override
>   public void onSuccess(T result) {
> delegate.onSuccess(result);
>   }
>
>   @Override
>   public void onFailure(Throwable caught) {
> if (caught instanceof Xxx) {
>   // handle failure
> } else {
>   delegate.onFailure(caught);
> }
>   }
> }
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "GWT Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/google-web-toolkit/Kt9DygTyQ-U/unsubscribe.
> To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Can I remove compile permutations for the default language

2017-07-20 Thread Kirill Prazdnikov
I recommend you dropping permutations at all. Leaving the one.
We did this few years ago and it`s good.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading to GWT 2.8.1 - GWTP Servlet Error

2017-07-20 Thread Renat Kabirov
I'm not sure about mailing list for gwtp. 

All is looking fine except this error occurs in Super Dev Mode, not regular 
running mode. 

On Wednesday, July 19, 2017 at 9:02:40 AM UTC-5, Michael Joyner wrote:
>
> Hrmmm does gwtp have a separate support mailing list? It really is a 
> server side issue, we don't use GWTP here at this time.
>
> On 07/19/2017 09:52 AM, Renat Kabirov wrote:
>
> My guess that code server somehow using servlet-api of 2.3, because after 
> compiling we have in target code libs servlet-api 2.3 which is not used by 
> any kind of dependency. Servlet-api 2.3 starts downloading before output of 
> checkstyle plugin. I tried to remove this plugin, but nothing changes.  
>
> About gwt-rpc, yes we are using couple dependencies from there: 
>
> 
> com.gwtplatform
> gwtp-dispatch-rpc-client
> ${gwtp.version}
> provided
>
> 
> 
> com.gwtplatform
> gwtp-dispatch-rpc-server-guice
> ${gwtp.version}
> 
>
> 
> com.gwtplatform
> gwtp-dispatch-rpc-shared
> ${gwtp.version}
> compile
>
>  
>
> where gwtp.version is 1.6, so they are latest. 
>
>
>
> On Wed, Jul 19, 2017 at 8:37 AM, Michael Joyner  > wrote:
>
>> At this point I'm at a bit of a loss I'm afraid. The issue is really 
>> happening as a servlet error based on what I'm seeing and not really as a 
>> GWT client front end issue. Are you using GWT-RPC? If yes, is the gwt rpc 
>> jar in the final war? Are any other required jars making it into your war 
>> (such as the rs-api jar)?
>>
>> On 07/18/2017 04:46 PM, Renat Kabirov wrote:
>>
>> Yes, we do, we have javax.ws.rs:javax.ws.rs-api 2.0.1 in our dependencies.
>>
>> On Tuesday, July 18, 2017 at 3:03:13 PM UTC-5, Michael Joyner wrote: 
>>>
>>> I just noticed one of our projects has as dependencies:
>>>
>>> providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
>>> compile 'javax.ws.rs:javax.ws.rs-api:2.0.1'
>>>
>>> Do you have the second one?
>>>
>>> On 07/18/2017 01:36 PM, Michael Joyner wrote:
>>>
>>>
>>> We use Gradle here and not Maven, so I'm stuck at this point. I do know 
>>> that when we previously tried 3.1.0 we had all sorts of issues with the 
>>> Tomcat version we were using at the time. You might need to include an 
>>> additional dependency for use by your servlet container. Jetty?
>>>
>>> On 07/18/2017 11:33 AM, Renat Kabirov wrote:
>>>
>>> Hi Michael Joyner,  
>>>
>>> Just changed version to 3.0.1 - I see error during building: 
>>>Module setup completed in 32400 ms
>>> java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionIdListener
>>> at 
>>> org.eclipse.jetty.server.session.SessionHandler.(SessionHandler.java:54)
>>> at 
>>> org.eclipse.jetty.servlet.ServletContextHandler.newSessionHandler(ServletContextHandler.java:241)
>>> at 
>>> org.eclipse.jetty.servlet.ServletContextHandler.getSessionHandler(ServletContextHandler.java:334)
>>> at 
>>> org.eclipse.jetty.servlet.ServletContextHandler.relinkHandlers(ServletContextHandler.java:180)
>>> at 
>>> org.eclipse.jetty.servlet.ServletContextHandler.(ServletContextHandler.java:157)
>>> at 
>>> org.eclipse.jetty.servlet.ServletContextHandler.(ServletContextHandler.java:117)
>>> at 
>>> org.eclipse.jetty.servlet.ServletContextHandler.(ServletContextHandler.java:105)
>>> at com.google.gwt.dev.codeserver.WebServer.start(WebServer.java:129)
>>> at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:162)
>>> at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:104)
>>> at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:55)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>> at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:498)
>>> at 
>>> com.google.gwt.dev.shell.SuperDevListener.runCodeServer(SuperDevListener.java:112)
>>> at 
>>> com.google.gwt.dev.shell.SuperDevListener.start(SuperDevListener.java:91)
>>> at com.google.gwt.dev.DevMode.ensureCodeServerListener(DevMode.java:666)
>>> at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:810)
>>> at com.google.gwt.dev.DevMode.doStartup(DevMode.java:551)
>>> at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:913)
>>> at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
>>> at com.google.gwt.dev.DevMode.main(DevMode.java:432)
>>> Caused by: java.lang.ClassNotFoundException: 
>>> javax.servlet.http.HttpSessionIdListener
>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>>> ... 23 more
>>> Disconnected from the target VM, address: '127.0.0.1:57494', transport: 
>>> 'socket'
>>>
>>> On Mon, Jul 17, 2017 at 3:51 PM, Michael Joyner  
>>> wrote:
>>>
 try putting serv

Re: Transpile plain Java project WITHOUT references to any UI, DOM, or any other web/framework features

2017-07-20 Thread Ryan Peden
I realize this question is a couple of weeks old, but I figure it's still 
worth answering in case you haven't found a solution. 

Do you run

require('react-native') 

before you try to load your GWT library? When RN loads, it does define a 
global window object 
.
 
I haven't tried using GWT generated code in React Native, but I've used 
them both quite heavily in the past, so I'll give it a try and see how it 
goes. 



On Thursday, June 29, 2017 at 7:13:36 AM UTC-4, Igor wrote:

> Hi all,
>
> I have a Java project which performs scientific calculations. It does not 
> have any dependencies and it does not reference any UI, DOM, or any other 
> web environment features. It is basically a few custom data structures and 
> algorithms. I wish to expose one class in this project using JsInterop and 
> consume it in a React Native and React app.
>
> I've successfully transpiled the Java into Javascript, but I am unable to 
> use it my React Native app because the resulting Javascript seems to 
> reference UI elements (there's always "var $wnd = $wnd || window.parent..." 
> at the top of the cache.js file which React Native chokes on). Is there a 
> way to achieve my goal and, if so, how?
>
> Thanks,
>
> Igor
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading to GWT 2.8.1 - GWTP Servlet Error

2017-07-20 Thread Thomas Broyer
Are you using AppEngine? How are you launching DevMode? Your Jetty 6 likely 
comes from the AppEngine SDK (it has only recently been upgraded to Jetty 9 
AFAIK)

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.