B4J Question Illegal reflective access by anywheresoftware.b4j.object.JavaObject

ivanomonti

Expert
Licensed User
Longtime User
I have this error which I don't understand

B4X:
WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by anywheresoftware.b4j.object.JavaObject (file:/C:/Program%20Files/Anywhere%20Software/B4J/Libraries/JavaObject.jar) to method sun.awt.windows.WToolkit.beep()
WARNING: Please consider reporting this to the maintainers of anywheresoftware.b4j.object.JavaObject
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
(ArrayList) [{priceChange=-21.97000000, symbol=BTCUSDT, askPrice=25734.71000000, bidQty=14.33575000, count=515252, openPrice=25756.67000000, lastId=3206621172, quoteVolume=464514558.76418940, bidPrice=25734.70000000, firstId=3206105921, volume=18034.22066000, lastQty=0.01741000, askQty=7.19837000, weightedAvgPrice=25757.39576008, lowPrice=25625.03000000, highPrice=25915.49000000, closeTime=1694007623811, prevClosePrice=25756.68000000, openTime=1693921223811, priceChangePercent=-0.085, lastPrice=25734.70000000}, {priceChange=0.18000000, symbol=ETHUSDT, askPrice=1632.95000000, bidQty=30.26250000, count=252954, openPrice=1632.77000000, lastId=1193886947, quoteVolume=242364220.83681000, bidPrice=1632.94000000, firstId=1193633994, volume=148296.67000000, lastQty=0.00860000, askQty=99.34140000, weightedAvgPrice=1634.32004803, lowPrice=1625.96000000, highPrice=1648.02000000, closeTime=1694007623178, prevClosePrice=1632.77000000, openTime=1693921223178, priceChangePercent=0.011, lastPrice=1632.95000000}]
(ArrayList) [{priceChange=3.49000000, symbol=BTCUSDT, askPrice=25760.00000000, bidQty=3.85170000, count=515518, openPrice=25756.51000000, lastId=3206623207, quoteVolume=465425155.06730360, bidPrice=25759.99000000, firstId=3206107690, volume=18069.62926000, lastQty=0.00025000, askQty=19.98039000, weightedAvgPrice=25757.31623324, lowPrice=25625.03000000, highPrice=25915.49000000, closeTime=1694007883165, prevClosePrice=25756.50000000, openTime=1693921483165, priceChangePercent=0.014, lastPrice=25760.00000000}, {priceChange=2.12000000, symbol=ETHUSDT, askPrice=1634.60000000, bidQty=8.31530000, count=253067, openPrice=1632.48000000, lastId=1193888092, quoteVolume=242213274.56135800, bidPrice=1634.59000000, firstId=1193635026, volume=148203.77300000, lastQty=0.18120000, askQty=133.48170000, weightedAvgPrice=1634.32596660, lowPrice=1625.96000000, highPrice=1648.02000000, closeTime=1694007883172, prevClosePrice=1632.49000000, openTime=1693921483172, priceChangePercent=0.130, lastPrice=1634.60000000}]
(ArrayList) [{priceChange=3.49000000, symbol=BTCUSDT, askPrice=25760.00000000, bidQty=10.81698000, count=515572, openPrice=25756.50000000, lastId=3206623343, quoteVolume=465355363.07487500, bidPrice=25759.99000000, firstId=3206107772, volume=18066.91847000, lastQty=0.03426000, askQty=11.59775000, weightedAvgPrice=25757.31793153, lowPrice=25625.03000000, highPrice=25915.49000000, closeTime=1694007901173, prevClosePrice=25756.51000000, openTime=1693921501173, priceChangePercent=0.014, lastPrice=25759.99000000}, {priceChange=2.12000000, symbol=ETHUSDT, askPrice=1634.60000000, bidQty=63.98190000, count=253098, openPrice=1632.48000000, lastId=1193888181, quoteVolume=242254331.69415300, bidPrice=1634.59000000, firstId=1193635084, volume=148228.88340000, lastQty=0.05630000, askQty=39.77870000, weightedAvgPrice=1634.32609177, lowPrice=1625.96000000, highPrice=1648.02000000, closeTime=1694007901177, prevClosePrice=1632.49000000, openTime=1693921501177, priceChangePercent=0.130, lastPrice=1634.60000000}]
(ArrayList) [{priceChange=2.07000000, symbol=BTCUSDT, askPrice=25756.05000000, bidQty=16.07482000, count=517484, openPrice=25753.98000000, lastId=3206628864, quoteVolume=470113836.56171380, bidPrice=25756.04000000, firstId=3206111381, volume=18251.91230000, lastQty=0.02619000, askQty=1.25492000, weightedAvgPrice=25756.96337100, lowPrice=25625.03000000, highPrice=25915.49000000, closeTime=1694008446821, prevClosePrice=25753.99000000, openTime=1693922046821, priceChangePercent=0.008, lastPrice=25756.05000000}, {priceChange=2.21000000, symbol=ETHUSDT, askPrice=1634.08000000, bidQty=121.59430000, count=253932, openPrice=1631.86000000, lastId=1193890963, quoteVolume=243093778.41925100, bidPrice=1634.07000000, firstId=1193637032, volume=148742.24550000, lastQty=0.06600000, askQty=1.23320000, weightedAvgPrice=1634.32908789, lowPrice=1625.96000000, highPrice=1648.02000000, closeTime=1694008447036, prevClosePrice=1631.86000000, openTime=1693922047036, priceChangePercent=0.135, lastPrice=1634.07000000}]
java.lang.RuntimeException: could not create platform window
    at javafx.graphics/com.sun.glass.ui.Window.<init>(Window.java:294)
    at javafx.graphics/com.sun.glass.ui.win.WinWindow.<init>(WinWindow.java:54)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.createWindow(WinApplication.java:219)
    at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.initPlatformWindow(WindowStage.java:201)
    at javafx.graphics/com.sun.javafx.tk.quantum.WindowStage.init(WindowStage.java:143)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.createTKPopupStage(QuantumToolkit.java:678)
    at javafx.graphics/javafx.stage.PopupWindow.doVisibleChanging(PopupWindow.java:514)
    at javafx.graphics/javafx.stage.PopupWindow$1.doVisibleChanging(PopupWindow.java:107)
    at javafx.graphics/com.sun.javafx.stage.PopupWindowHelper.visibleChangingImpl(PopupWindowHelper.java:57)
    at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanging(WindowHelper.java:73)
    at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1064)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
    at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1174)
    at javafx.graphics/javafx.stage.Window.show(Window.java:1189)
    at javafx.graphics/javafx.stage.PopupWindow.showImpl(PopupWindow.java:472)
    at javafx.graphics/javafx.stage.PopupWindow.show(PopupWindow.java:437)
    at javafx.controls/javafx.scene.control.Tooltip$TooltipBehavior.lambda$new$0(Tooltip.java:899)
    at javafx.graphics/javafx.animation.Animation.finished(Animation.java:1131)
    at javafx.graphics/javafx.animation.AnimationAccessorImpl.finished(AnimationAccessorImpl.java:49)
    at javafx.graphics/com.sun.scenario.animation.shared.SingleLoopClipEnvelope.timePulse(SingleLoopClipEnvelope.java:101)
    at javafx.graphics/javafx.animation.Animation.doTimePulse(Animation.java:1101)
    at javafx.graphics/javafx.animation.Animation$1.lambda$timePulse$0(Animation.java:186)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at javafx.graphics/javafx.animation.Animation$1.timePulse(Animation.java:185)
    at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:344)
    at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:559)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:543)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:536)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:342)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:832)
(RuntimeException) java.lang.RuntimeException: could not create platform window
 

OliverA

Expert
Licensed User
Longtime User
None of the WARNING(s) should be the issue (that are just warnings (which at a future JDK may cause failures, but not now)). As to your error, it would be nice if you could furnish a sample application that creates this error.
 
Upvote 1

ivanomonti

Expert
Licensed User
Longtime User
Nessuno degli AVVERTIMENTI dovrebbe essere il problema (che sono solo avvisi (che in un futuro JDK potrebbero causare errori, ma non ora)). Per quanto riguarda il tuo errore, sarebbe carino se potessi fornire un'applicazione di esempio che crea questo errore.
Lo farei se sapessi cosa ha causato l'errore
None of the WARNING(s) should be the issue (that are just warnings (which at a future JDK may cause failures, but not now)). As to your error, it would be nice if you could furnish a sample application that creates this error.
I would do it if I knew what triggered the error
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Are you creating lots of pop-up / dialogue windows and not reusing them?
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

agraham

Expert
Licensed User
Longtime User
Interesting, but that case doesn't involve the use of reflection. However he might have a point and I apologise that I was unaware of this to potentially cause the problem.

Whatever code is using the JavaObject is unfortunately called directly off the message loop according to the stack trace so it may be being called in a ResumableSub. This is a pity as we can't easily see the B4J code methods involved.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
I think the JavaObject is a red herring. It's just moaning because of access to a package with a name starting with 'sun.*' as they are not meant to be accessesd by user code.

The program seems to have run for a short while ( assuming the arrays are filled by http or similar ) then it errors.

The error mentions tooltips . Maybe try disabling the tooltips and see if it still errors,.

As @OliverA said it's a PITA error (Pain in the ***) to track down.
 
Last edited:
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
ho riscritto tutto il codice per cercare di venirne a capo, non vorrei dire una cazzata ma sembra che il problema sia legato ai font, ora sto ancora verificando ma da quanto ho tolto i font l'errore non si ripresenta

I rewrote all the code to try to get to the bottom of it, I don't want to say bullshit but it seems that the problem is related to the fonts, now I'm still checking but since I removed the fonts the error doesn't come back

1694629378272.png
 
Upvote 0
Top