Using GWT, I have deployed my server into Tomcat. This works fine, but when GWT throws an exception, a Popup shows the client the stack trace of the exception.
In dev mode, this works fine. In Tomcat, I get the below stack trace.
Why and how do you fix this?
Unknown.Le(StackTraceCreator.java:168) Unknown.Jd(StackTraceCreator.java:421) Unknown.NT(Exception_FieldSerializer.java:16) Unknown.g1(SerializerBase.java:55) Unknown.b1(SerializerBase.java:112) Unknown.D$(AbstractSerializationStreamReader.java:119) Unknown.uAc(CustomException_FieldSerializer.java:39) Unknown.uBc(ServerSideException_FieldSerializer.java:12) Unknown.f1(SerializerBase.java:46) Unknown._0(SerializerBase.java:92) Unknown.D$(AbstractSerializationStreamReader.java:119) Unknown.B_(RequestCallbackAdapter.java:216) Unknown._o(Request.java:287)
After using @Christian Kuetbach’s answer, here is what I get now:
Unknown.com_google_gwt_core_client_impl_StackTraceCreator$CollectorEmulated_$fillInStackTrace__Lcom_google_gwt_core_client_impl_StackTraceCreator$CollectorEmulated_2Ljava_lang_Throwable_2V(StackTraceCreator.java:168)
Unknown.java_lang_Throwable_Throwable__Ljava_lang_String_2Ljava_lang_Throwable_2V(StackTraceCreator.java:421)
Unknown.com_google_gwt_user_client_rpc_StatusCodeException_StatusCodeException__ILjava_lang_String_2V(StatusCodeException.java:35)
Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(RequestCallbackAdapter.java:209)
Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Request.java:287)
Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(RequestBuilder.java:395) Unknown.anonymous(XMLHttpRequest.java:287)
Please Help!
It’s a bit difficult to find all the information in the GWT docs, which you need to setup de-obfuscated logging, so here’s the short version:
In your module file (.gwt.xml), add:
On the client side, use something like
You don’t have to create a
RemoteLoggingServiceAsyncinstance on the client side – it’s used automatically by the logger, because we specified<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />.On the server side, configure the RemoteLoggingServiceImpl. You will have to tell it, where it finds the symbolMaps, which will be generated when compiling with the GWT compiler argument
-extra /path/to/myExtraDir. I personally use the approach to override RemoteLoggingServiceImpl, to allow specifying the directory from web.xml’s<init-param>s [*]In
web.xml, register it likeReplace
/path/to/myExtraDir,mymodulenameandmypackagewith your own values, and don’t forget to call the GWT compiler with the-extraargument (Note that you you don’t have to use-style PRETTYor DETAILED, it also works with OBF). Keep all generated symbolMaps: Without them, deobfuscation will not work. As every new version gets a unique name automatically, you can collect them all in a safe central place when building.[*] And I really, really wonder, why RemoteLoggingServiceImpl doesn’t implement that itself!