Bug 212147 - It's impossible to run javafx project 2 times simultaneously
It's impossible to run javafx project 2 times simultaneously
Product: javafx
Classification: Unclassified
Component: Project
PC Windows 7
: P3 (vote)
: 7.3
Assigned To: Petr Somol
: 205368 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2012-05-06 21:19 UTC by Sergey Grinev
Modified: 2012-08-30 17:28 UTC (History)
2 users (show)

See Also:
Issue Type: TASK


Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Grinev 2012-05-06 21:19:18 UTC
Steps to reproduce:
1. Create new JavaFX project in NetBeans 7.1.2
2. Right click on project name and choose "Run" -- app will run normally
3. Repeat without closing first app

You will see next error message:

Deleting: C:\Users\XXX\Documents\NetBeansProjects\JavaFXApplication28\build\built-jar.properties
Updating property file: C:\Users\XXX\Documents\NetBeansProjects\JavaFXApplication28\build\built-jar.properties
Detected JavaFX Ant API version 1.1
Launching <fx:jar> task from C:\Program Files (x86)\Oracle\JavaFX 2.1 SDK\lib\ant-javafx.jar
C:\Users\XXX\Documents\NetBeansProjects\JavaFXApplication28\nbproject\jfx-impl.xml:1805: The following error occurred while executing this line:
C:\Users\XXX\Documents\NetBeansProjects\JavaFXApplication28\nbproject\jfx-impl.xml:1230: can't parse argument number: 

N.B.: worked fine in 7.1
Comment 1 Petr Somol 2012-05-10 13:21:13 UTC
*** Bug 205368 has been marked as a duplicate of this bug. ***
Comment 2 dukke 2012-06-02 16:00:56 UTC
I think this is very important when creating GUI apps. There is a need to compare changes you've made in the UI and without being able to run multiple instances of the app at the same time this process gets more complicated than should be.
Comment 3 Petr Somol 2012-06-05 11:01:32 UTC
Actually this is not a bug, it is in fact missing functionality. The reason is as follows. JavaFX deployment and launch model differs considerably from SE, where Run simply reuses compiled artifacts if there has been no change that would trigger recompilation. However, it has been agreed with the JavaFX core team that FX Projects need to be (re)deployed before every Run/Debug. Every Run/Debug thus calls the FX SDK internal Ant tasks <fx:jar> and <fx:deploy> that create various deployment artifacts in addition to the jar executable. Therefore, as there is no specific support of multiple Run/Debug, there is no specific guarantee as of what happens when FX Project is run several times at once; it may succeed or it may not, depending in what stage the FX Ant tasks are and whether file locks are held or not. This has been the case since the first FX2 support in 7.1, the seemingly different behavior then and now is coincidental.

Nevertheless we see the demand for multiple FX Project Run support. This will involve changes in the build/deployment process that would create separate copies of FX Project artifacts for each of the runs (though identical copies) to prevent race conditions. As this change is too far reaching and 7.2 release is too near, I am changing this issue to a TASK to be resolved for next NB release. See also http://wiki.netbeans.org/NB73_FX2_Plan
Comment 4 Petr Somol 2012-08-07 13:03:53 UTC
fixed in jet-main:

Now the functionality is as follows:
- by default when running FX project standalone, a temporary copy of dist/ subdir contents is created and the project is run from there. Repeated run is thus run from a separate copy, what prevents file lock clashes. It is possible to run the project, let the running application open, rebuild the project and run it in modified state once more (e.g. to compare). Note however that calling Clean while any number of project instances are running is not supported (Clean attempts to remove all temporary artifacts including all temporary copies of dist/ subdir that are used by the running instances)
- by default when running FX project as WebStart or in Browser, temporary dist/ copy is not created and the project is run as before (directly from dist/), i.e., an attempt to run once more fails. However, concurrent run can be switched on by setting the property javafx.enable.concurrent.external.runs=true. This is not done by default to prevent synchronization issues following from the launch of external processes (javaws, browser).
- any multiple concurrent project runs can be globally disabled by setting javafx.disable.concurrent.runs=true. This setting disables temporary dist/ copies for all Run-as modes (standalone, webstart, in browser).
- debug and profile work as before, there seems to be no use-case for enabling concurrent multiple debugs/profilings of one project.
Comment 5 Quality Engineering 2012-08-10 02:24:51 UTC
Integrated into 'main-golden', will be available in build *201208100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4b5bd0b38e1c
User: Petr Somol <psomol@netbeans.org>
Log: #212147 - It's impossible to run javafx project 2 times simultaneously
Comment 6 Stepan Zebra 2012-08-27 13:02:44 UTC
verified in trunk
Comment 7 Petr Somol 2012-08-30 17:28:09 UTC
removed 72patch1-candidate keyword as this issue changes build infrastructure too extensively to be considered a patch of an existing one

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo