United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7182660 : Can't save file using FileSaveService when running FX applet

Details
Type:
Bug
Submit Date:
2012-07-09
Status:
Resolved
Updated Date:
2012-07-11
Project Name:
JDK
Resolved Date:
2012-07-11
Component:
deploy
OS:
generic
Sub-Component:
deployment_toolkit
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u6
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Initially filed in JIRA - http://javafx-jira.kenai.com/browse/RT-23205

but the fix requires changes on JRE side.

Thread dump attached.

                                    

Comments
EVALUATION

Problem caused by attempt to offload work from main FX thread to system thread that then tries get it back on the same FX thread
but it is blocked. In AWT case we will use another EDT and this will avoid this type of deadlock but JavaFX has single JavaFX application thread.

The fix starts using Waiter interface. In JavaFX case this will enter the nested event loop before blocking current event loop. 
In AWT case this will just execute requested operation in place.

The hang is always reproducible when FileSaveService is called from the FX app thread.

AWT case - Waiter calls task.run (com.sun.deploy.util.Waiter.default_waiter) and the change has no impact on AWT
FX case - Waiter starts nested event loop and starts new worker thread to call task.run (com.sun.deploy.uitoolkit.impl.fx.FxWaiter) and unblocks file chooser
                                     
2012-07-10
SUGGESTED FIX

http://closedjdk.us.oracle.com/jdk8/deploy/deploy/rev/a6493e888908
                                     
2012-07-10



Hardware and Software, Engineered to Work Together