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:
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
*** Bug 205368 has been marked as a duplicate of this bug. ***
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.
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
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.
Integrated into 'main-golden', will be available in build *201208100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Petr Somol <firstname.lastname@example.org>
Log: #212147 - It's impossible to run javafx project 2 times simultaneously
verified in trunk
removed 72patch1-candidate keyword as this issue changes build infrastructure too extensively to be considered a patch of an existing one