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 34355 - IDE enters endless restart loop if auto-update fails
Summary: IDE enters endless restart loop if auto-update fails
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords:
: 33725 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-06-12 17:21 UTC by RyanOlson
Modified: 2005-07-13 13:27 UTC (History)
0 users

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 RyanOlson 2003-06-12 17:21:40 UTC
If an auto-update operation fails (hangs and has
to be killed), one or more of the xml files in the
user's update_tracking directory will end up being
empty, which causes the auto-update feature to
kick in and freeze whenever the IDE starts up.
Furthermore, the IDE auto-update process respawns
whenever the IDE is quit or killed, which makes it
impossible to exit the IDE through normal means.

I originally encountered this problem when an
auto-update operation froze in the installation
step while installing the Ant documentation, Junit
tests, and Fast Javac modules, and had to be
killed. I found that several of the XML files in
~/.netbeans/3.5/update_tracking/ were empty after
this happened, and whevever the auto updater
respawned to try to complete the operation the
following exception was reported on the console:

Bad update_tracking
org.xml.sax.SAXParseException: Premature end of file.
        at
org.apache.xerces.parsers.DOMParser.parse(Unknown
Source)
        at
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
        at
org.netbeans.updater.XMLUtil.parse(XMLUtil.java:58)
        at
org.netbeans.updater.UpdateTracking.readModuleFromFile(UpdateTracking.java:301)
        at
org.netbeans.updater.UpdateTracking.readModuleTracking(UpdateTracking.java:283)
        at
org.netbeans.updater.ModuleUpdater.unpack(ModuleUpdater.java:303)
        at
org.netbeans.updater.ModuleUpdater.run(ModuleUpdater.java:131)
java.lang.NullPointerException
        at
org.netbeans.updater.ModuleUpdater.unpack(ModuleUpdater.java:304)
        at
org.netbeans.updater.ModuleUpdater.run(ModuleUpdater.java:131)

Each time I killed the frozen update process the
IDE would launch as normal, but then once I quit
the IDE the updater would come back and freeze
again, ad infinitum. I solved the problem by
deleting the empty XML files.

I'd recommend that the updater include logic to
more gracefully handle this condition (empty XML
files) instead of throwing an exception and hanging.

- rdo
Comment 1 jd 2003-07-25 16:56:57 UTC
*** Issue 33725 has been marked as a duplicate of this issue. ***
Comment 2 Antonin Nebuzelsky 2003-07-31 15:53:49 UTC
Fixed in trunk (and for nevada patch 1). Deleting the file if found
empty and letting it be regenerated (by the code already in place):

Index: UpdateTracking.java
===================================================================
RCS file:
/cvs/autoupdate/libsrc/org/netbeans/updater/UpdateTracking.java,v
retrieving revision 1.9
diff -c -r1.9 UpdateTracking.java
*** UpdateTracking.java	19 Dec 2002 04:21:38 -0000	1.9
--- UpdateTracking.java	29 Jul 2003 13:14:13 -0000
***************
*** 273,278 ****
--- 273,287 ----
          
          File file = new File( dir + FILE_SEPARATOR +
TRACKING_FILE_NAME +
FILE_SEPARATOR
                          + getTrackingName( codename ) + XML_EXT );
+         
+         // fix for #34355
+         try {
+             if ( file.exists() && file.length()==0 )
+                 file.delete();
+         } catch (Exception e) {
+             // ignore
+         }
+         
          if ( ! file.exists() ) {
              if ( create )
                  return new Module( codename, file, fromuser );

Comment 3 Marian Mirilovic 2005-07-13 13:27:08 UTC
closed