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 200218 - Updating JNLP build script fails
Summary: Updating JNLP build script fails
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Java Webstart (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Petr Somol
URL:
Keywords:
Depends on:
Blocks: 206641
  Show dependency tree
 
Reported: 2011-07-19 06:48 UTC by Iksa
Modified: 2012-10-25 09:24 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Iksa 2011-07-19 06:48:22 UTC
Product Version = NetBeans IDE 7.0 (Build 201104080000)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_23
Runtime = Java HotSpot(TM) Client VM 19.0-b09

In a Java applet project's properties -> Web Start tab it says: A previous or modified version of the JNLP build script was detected. To upgrade to the current version, uncheck Enable Web Start, and click OK. Then reopen the Project Properties dialog and enable Java Web Start again.

I uncheck 'Enable Web Start', click OK, then select properties again, check 'Enable Web Start' and click OK. It gives a message box saying "Cannot rename file jnlp-impl.xml in C:/.../nbproject to jnlp-impl_backup.xml". I click OK, then select properties and I'm in the beginning again with the initial message.
Comment 1 Tomas Zezula 2011-07-19 11:29:14 UTC
Seems that jnlp-impl_backup.xml exists and is read only or the nbproject is read only..
Can you verify it?
Comment 2 Petr Somol 2011-07-21 16:02:37 UTC
Another way to reproduce the same bahavior:

1. create a java applet project (Java Application project without main class + add any of New JApplet, Applet, JApplet Form or Applet Form)

2. enable WebStart in project properties, press OK to close the properties dialog. This creates jnlp-impl.xml file in nbproject subdirectory

3. change jnlp-impl.xml from outside NetBeans (close whatever external tool you used so that the problem is not shadowed by forgotten external lock)

4. in NetBeans open the project's WebStart panel. It is now grayed, displaying the Resolve button. Press the button. Then press OK. Now the problem manifests itself by the message saying "Cannot rename file jnlp-impl.xml ...

-----
Observations:
- the problem is reproducible with any applet type, but not with ordinary Java Application. 
- I have checked that nor jnlp-impl.xml nor nbproject directory were read-only nor locked from the outside
- when debugging, the problem sometimes occurs and sometimes does not (even across repeated debugging sessions with unchanged code). When run (no debugging), the problem occurs always.

So far could not find why FileUtil.moveFile() fails in JWSCompositeCategoryProvider.SavePropsListener.copyTemplate().

-----
Workaround: manually delete C:/.../nbproject/jnlp-impl.xml file, then open project's properties -> Web Start. The dialog now does not ask for Repair. Press OK and jnlp-impl.xml is recreated.
Comment 3 Iksa 2011-07-23 12:29:05 UTC
Verified that jnlp-impl_backup.xml does not exist and nbproject is not read only. If they were, it would be nice to have the error message clearly saying it.
Comment 4 jla 2011-12-07 21:56:06 UTC
I have a Web Start application that was created in NetBeans 6.8 and used the master-component.jnlp template. After upgrading to 7.0 I noticed a new jnlpcomponent1.jnlp file so I went to the project Web Start properties and saw the same prompt as Iksa, that I should disable and re-enable Web Start.

When I tried to enable web start again, I get a similar error:

Warning
[!] Subversion failed to move
[ full path to Project\nbproject\jnlp-impl.xml] to:
[ full path to Project\nbproject\jnlp-impl_backup.xml]
org.tigris.subversion.javahl.ClientException: The process cannot access the file because it is being
used by another process.
svn: Can't move file
'[ full path to Project\nbproject\jnlp-impl.xml]': The process
cannot access the file because it is being used by another process.
[ OK ]

At this point a new jnlp-impl_backup.xml exists, has a current time stamp, and is not read-only. jnlp-impl.xml still has the old time stamp and is not read-only.

The subversion status of the two files is deleted for jnlp-impl.xml and added for jnlp-impl_backup.xml.

Sysinternals Process Explorer doesn't show either of those files open by anything. Then again, it doesn't show any of the files open in the NetBeans editor.
Comment 5 Petr Somol 2011-12-21 12:28:01 UTC
I found a problem with incorrect InputStream handling on the jnlp-impl.xml file
that is likely to be the reason for this bug (jnlp-impl.xml was attempted to be moved at a moment when an InputStream could still be opened on it). 
This is now corrected in jet-main by changeset:
http://hg.netbeans.org/jet-main/rev/2aebcfa3e302

After this fix I can not reproduce the bug in scenarios known to me (cf. Comment #2) so I am closing the bug. 
Please reopen if you are still able to find cases of the same faulty behavior (i.e., if a message saying something like "Cannot rename file jnlp-impl.xml in...." or "Can't move file jnlp-impl.xml..." or so does appear again).
Comment 6 Stepan Zebra 2011-12-22 13:49:20 UTC
fix verified in trunk
Comment 7 Quality Engineering 2011-12-24 15:57:39 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/2aebcfa3e302
User: Petr Somol <psomol@netbeans.org>
Log: #200218 - Updating JNLP build script fails
Comment 8 Petr Somol 2012-01-16 13:41:57 UTC
transplanted to release71_fixes branch as
http://hg.netbeans.org/releases/rev/023d6681fd49
http://hg.netbeans.org/releases/rev/cafd5db2b02a
Comment 9 Stepan Zebra 2012-02-03 13:15:17 UTC
verified in release71_fixes