Debugging in browser and fixing bck2brwsr was: generated JS issue in Chrome, but not built-in browser

Skip to first unread message

Jaroslav Tulach

May 19, 2016, 12:28:59 AM5/19/16
to, erd,
### erd : 18. 5. 2016 @ 15:01 ###
> I fixed the 404's by making the classpath prefix just '/'.
> After some sleuthing, I figured out the TypeError is caused by Jackson, but
> I'm still unsure of how to fix it. More specifically, invoking ObjectMapper
> breaks everything, eg
> static private ObjectMapper mapper = new ObjectMapper();

If you right click on "client-web" project and do "Clean" and then once again
and select "Debug", you'll be able to see reasonable code in the browser.

I used chromium with "Pause on Exceptions" being true and this is the

invoker.clone__Ljava_lang_Object_2 (emul-0.19-rt.js:256614)
c.getDefault__Ljava_util_TimeZone_2 (emul-0.19-rt.js:102513)
c.initializeCalendar__VLjava_util_Locale_2 (emul-0.19-rt.js:56142)
CLS.cons__VLjava_lang_String_2Ljava_util_Locale_2 (emul-0.19-rt.js:55950)
c.class__V (jackson-databin…2.6.3.js:44848)
com_fasterxml_jackson_databind_util_StdDateFormat (jackson-databin…
c.class__V (jackson-databin…2.6.3.js:43935)
com_fasterxml_jackson_databind_ObjectMapper (jackson-databin…2.6.3.js:43962)
loadClass (bck2brwsr.js:163)
(anonymous function) (dukescript-plot…SNAPSHOT.js:21)
c.class__V (dukescript-plot…PSHOT.js:17248)
net_java_html_plotlyjs_Plotly (dukescript-plot…PSHOT.js:17275)
loadClass (bck2brwsr.js:163)
(anonymous function) (PlotlySample-1.…SNAPSHOT.js:33)
c.onPageLoad__V (PlotlySample-1.…NAPSHOT.js:868)
c.onPageLoad__V (PlotlySample-1.…APSHOT.js:2184)
c.main__V_3Ljava_lang_String_2 (mainclass.js:67)
invokeMethod (bck2brwsr.js:47)
extensionLoaded (bck2brwsr.js:33)

Looks like java.util.TimeZone.getDefault() isn't implemented properly in
bck2brwsr. Do you want to help me fix it? If so, the code is here:
Probably the best way to start is to copy one of the tests at
and show that there is a difference between TimeZone.getDefault() on HotSpot
and on bck2brwsr VM. And then fix it.


PS: I tried to use "Custom->Run in Browser via TeaVM", but TeaVM is out of
lack as jackson uses quite a lot of reflection and it cannot handle it.

Jaroslav Tulach

May 20, 2016, 12:09:02 AM5/20/16
to erd,,
Here is the fix of TimeZone.getDefault() to return something:

### Jaroslav Tulach : 19. 5. 2016 @ 06:28 ###
Reply all
Reply to author
0 new messages