This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236732 - [74cat] Build/Run/Debug all fail with errors after a change to a source file. A subsequent attempt is successful.
Summary: [74cat] Build/Run/Debug all fail with errors after a change to a source file....
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Deployment (show other bugs)
Version: 7.4
Hardware: PC Windows 8
: P3 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-04 05:42 UTC by Lou Dasaro
Modified: 2013-12-08 09:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Error received every other run (98.38 KB, image/jpeg)
2013-10-04 05:42 UTC, Lou Dasaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lou Dasaro 2013-10-04 05:42:04 UTC
Created attachment 140790 [details]
Error received every other run

Build/Run/Debug all fail with errors after a change to source files. A subsequent attempt is successful. If you make a change to source files, the error occurs again, and so on...

Purpose: Test NetBeans Deployment of JavaFX project.
Setup: Java Platform 7u25 or 7u40 and NetBeans 7.4 RC1/RC2/DEV, Windows 8  

Create New JavaFX FXML Application in NetBeans 
   Invoke File | New Project... from main menu. "New Project" wizard shows up.
   In the first step of the wizard select "JavaFX" category and "JavaFX FXML Application" project. Push Next > button.
   Keep all default settings and push Finish.
   Push the Debug Button, the app will run in debug mode. Close the app.
   Add a few <CR> on a blank line in FXMLDocumentController.java
   Push the Debug Button   

EXPECTED RESULT: The app will run in debug mode. 

ACTUAL RESULT: Build fails with errors. See attachment. See also Bug 226499

If it doesn't happen the first time (rare), repeat the debug/edit/debug cycle a few times. 

Environment:
Product Version: NetBeans IDE 7.4 RC1 (Build 201309162201)
Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Product Version: NetBeans IDE Dev (Build 201310030001)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)
Comment 1 David Strupl 2013-10-04 05:56:49 UTC
Hello,

is the problem related to the fact that you do the re-build cycle too fast? Are you able to reproduce when you do the re-build slowly, e.g. waiting for example one minute and then rebuild?

Thanks,

David
Comment 2 Lou Dasaro 2013-10-04 07:18:40 UTC
The problem seems to be that I'm making a change to a source file, and clicking on Debug or Run button (without first saving). I can make the change to source and walk away for 1/2 hour, click on Debug, and I will still get the error.
Comment 3 David Strupl 2013-10-04 07:46:49 UTC
Aha, I see. This was important info (that it happens when you don't save the file). Thanks.
Comment 4 Roman Svitanic 2013-10-04 08:16:43 UTC
Thanks for the report!

Could you please try to reproduce the issue with following change in jfx-impl.xml? Thanks.

-> Replace macrodef "deploy-sign" with following:

    <macrodef name="deploy-sign">
        <sequential>
            <echo message="keystore=${javafx.signjar.keystore}" level="verbose"/>
            <echo message="storepass=${javafx.signjar.storepass}" level="verbose"/>
            <echo message="alias=${javafx.signjar.alias}" level="verbose"/>
            <echo message="keypass=${javafx.signjar.keypass}" level="verbose"/>
            <mkdir dir="${jfx.deployment.dir}/signed"/>
            <signjar keystore="${javafx.signjar.keystore}"
                     storepass="${javafx.signjar.storepass}"
                     alias="${javafx.signjar.alias}"
                     keypass="${javafx.signjar.keypass}" destdir="${jfx.deployment.dir}/signed">
                <fileset dir="${jfx.deployment.dir}">
                    <include name="${jfx.deployment.jar}"/>
                    <include name="lib${file.separator}*.jar"/>
                </fileset>
            </signjar>
            <copy todir="${jfx.deployment.dir}" overwrite="true">
                <fileset dir="${jfx.deployment.dir}/signed">
                    <include name="**/*"/>
                </fileset>
            </copy>
            <delete dir="${jfx.deployment.dir}/signed" />
        </sequential>
    </macrodef>
Comment 5 Lou Dasaro 2013-10-04 08:38:47 UTC
As you requested, I replaced macrodef "deploy-sign".

The change fixed the bug in both RC2 and DEV as far as I can tell!!!

I will check again after some sleep - it's very late in Chicago...
Comment 6 Tomas Zezula 2013-10-04 12:56:20 UTC
Personally I doubt it will help.
The <jarsign> Ant Task just executes Oracle jarsigner.
If you look at the jarsigner source http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/9f57d2774603/src/share/classes/sun/security/tools/jarsigner/Main.java line 1358 you will find that the jarsigner does the temporary file itself. So the "signed/*jar" moved to original jar has the same problem.

It's important to find out who is holding the File Handle to the jar.

1st) We need to verify that it's NetBeans,this can be done using the MS Process Monitor http://technet.microsoft.com/en-us/sysinternals/bb896645.

2nd) If so, I will write and attach an agent which will print out stack trace of the caller which opened the jar and did not close it.
Comment 7 Tomas Zezula 2013-10-04 16:34:41 UTC
Here is a modified tools.jar with debug logging https://dl.dropboxusercontent.com/u/79648505/tools.jar.
Roman can you try to reproduce the problem with it? Simply replace the ${JDK_HOME}/lib/tools.jar with it and run the the IDE on this modified JDK.
You should see output like:
Signing file: /Users/tom/NetBeansProjects/JavaFXApplication2/dist/JavaFXApplication2.jar into: /Users/tom/NetBeansProjects/JavaFXApplication2/dist/JavaFXApplication2.jar.sig
in the output window. When it fails it should print what was the reason.
Thanks!
Comment 8 Lou Dasaro 2013-10-04 21:51:38 UTC
The modified 'deploy-sign' seemed to fix the bug using the basic JavaFX FXML "Hello world" project (timing, perhaps?). I performed the test a few dozen times and it looked good...

But this morning the error returned after I had added Hibernate cfg, reveng, and eight Hibernate pojos to the project. I don't think it has anything to do with Hibernate, per se. Let me know if you need further testing.
Comment 9 Lou Dasaro 2013-10-04 22:12:19 UTC
In my previous tests, I had NOT enabled Blob signing.

Enable Blob Signing makes the problem go away, so this is the workaround, and another clue.
Comment 10 Lou Dasaro 2013-10-24 07:38:22 UTC
Anomaly also exists in Windows 8.1, just as sporadic as before.
Comment 11 Lou Dasaro 2013-11-22 17:22:41 UTC
Anomaly not present in NetBeans 7.4-patch1
Possibly fixed as a side-effect of other changes(?).
Will verify in the publicly-available patch.