Re: [codenameone-discussions] Browsercomponent crash in simulator

13 views
Skip to first unread message

Steve Hannah

unread,
Aug 22, 2019, 1:58:57 PM8/22/19
to codenameone...@googlegroups.com
This is more likely a change in the JRE.   The relevant classes haven't been modified since 2018.  What JDK are you running on?  What OS/version?

On Thu, Aug 22, 2019 at 10:27 AM Thomas <tomber...@gmail.com> wrote:
I just updated my fork with the latest dev version of CN1 and I have this error thrown when launching an app containing a BrowserComponent in the simulator:

[JavaFX Application Thread] 0:0:6,797 - Exception: java.lang.ClassCastException - com.sun.webkit.dom.JSObject cannot be cast to netscape.javascript.JSObject
java.lang.ClassCastException: com.sun.webkit.dom.JSObject cannot be cast to netscape.javascript.JSObject
at com.codename1.impl.javase.SEBrowserComponent$6.changed(SEBrowserComponent.java:307)
at com.codename1.impl.javase.SEBrowserComponent$6.changed(SEBrowserComponent.java:1)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:74)
at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
at javafx.scene.web.WebEngine$LoadWorker.updateState(WebEngine.java:1287)
at javafx.scene.web.WebEngine$LoadWorker.dispatchLoadEvent(WebEngine.java:1388)
at javafx.scene.web.WebEngine$LoadWorker.access$1200(WebEngine.java:1280)
at javafx.scene.web.WebEngine$PageLoadListener.dispatchLoadEvent(WebEngine.java:1267)
at com.sun.webkit.WebPage.fireLoadEvent(WebPage.java:2499)
at com.sun.webkit.WebPage.fwkFireLoadEvent(WebPage.java:2343)
at com.sun.webkit.WebPage.twkOpen(Native Method)
at com.sun.webkit.WebPage.open(WebPage.java:1231)
at javafx.scene.web.WebEngine.load(WebEngine.java:932)
at com.codename1.impl.javase.SEBrowserComponent.setURL(SEBrowserComponent.java:768)
at com.codename1.impl.javase.JavaSEPort$83.run(JavaSEPort.java:11136)
at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)

this problem was introduced in on of the commits of these last 3 days (as the latest sync of my fork with CN1 was in Aug 19 and the same app was running OK in the simulator at that time and I didn't change anything in my local computer configuration till then) 

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/bc99c585-9a33-43e7-b732-d7d918606b8e%40googlegroups.com.


--
Steve Hannah
Software Developer
Codename One

Thomas

unread,
Aug 22, 2019, 2:09:32 PM8/22/19
to CodenameOne Discussions
Sorry I deleted this post since as I thought the issue was solved (I manually rebuild the JavaSE jar of CN1 for the simulator as it appears my IDE did not automatically do it (as it is usually the case) after the merge and was able to run my app in the simulator correctly after that but I just retried to run my app in the simulator another time and the bug reappeared :( )
I am using JDK 10+46 64b version and running the simulator from eclipse on Windows 10 pro

To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.

Shai Almog

unread,
Aug 22, 2019, 10:32:24 PM8/22/19
to CodenameOne Discussions
From this it looks like a problem with the Eclipse plugin: https://stackoverflow.com/questions/21607971/javafx-upcall-cannot-cast-jsobject
That's odd since this shouldn't be impacted by eclipse in any way... I'll have to look into it. Please file an issue.

Thomas

unread,
Aug 23, 2019, 8:26:05 AM8/23/19
to CodenameOne Discussions
I was able to solve this issue by setting my projects (CN1 core, CN1-JavaSE and my CN1 app) compiler compliance level to 10 and then back  to 1.8 (which forced a rebuild of all classes). I don't really know what appened (probably a class file that was corrupted). I hope this is now solved for good and that it won't appear again (as the last time, I manually performed a rebuild of CN1-JavaSE and it solved the issue but only temporarily as I was only able to run my app once in the simulator after that...) else I would fill an issue on github
Reply all
Reply to author
Forward
0 new messages