Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
595 views
in Technique[技术] by (71.8m points)

javafx - java.lang.StackOverflowError when pressing FX ComboBox on Android

When using JavaFXPorts on Android (Android 4.1.1 on Asus Transformer Prime TF201 tablet), a java.lang.StackOverflowError is thrown when pressing on a ComboBox (see below the top stacks of the stacktrace).

It happens in a ComboBox in my FX application and is also 100% reproducible with the ComboBox example that is in Ensemble. In other words: can't use JavaFX ComboBox.

I'm aware of the Android stack size limit posted in many forums and there are various suggestions on what to do when it happens with Android UI and Android APIs. However, can't find a relevant idea to apply when using JavaFX UI and JavaFXPorts.

Any idea for a fixweakworkaround would be much appreciated.

E/AndroidRuntime(32212): FATAL EXCEPTION: JavaFX Application Thread
E/AndroidRuntime(32212): java.lang.StackOverflowError
E/AndroidRuntime(32212):        at javafx.scene.Node.getTransformedBounds(Node.java:3422)
E/AndroidRuntime(32212):        at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
E/AndroidRuntime(32212):        at javafx.scene.Parent.recomputeBounds(Parent.java:1516)
E/AndroidRuntime(32212):        at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
E/AndroidRuntime(32212):        at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
E/AndroidRuntime(32212):        at javafx.scene.Node.updateGeomBounds(Node.java:3577)
E/AndroidRuntime(32212):        at javafx.scene.Node.getGeomBounds(Node.java:3530)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can create the java.custom.properties file, and include in it this property:

monocle.stackSize=128000

You can override other system properties as well by including them with their new values.

Put the file at the root of your classpath, e.g. in the folder src/android/resources of your project.

You can find this FAQ here here and all the documentation for JavaFXPorts here.

Check if this solves your exception.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...