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 151273 - Corrupted configurations.xml
Summary: Corrupted configurations.xml
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on: 151685
Blocks:
  Show dependency tree
 
Reported: 2008-10-24 13:32 UTC by Egor Ushakov
Modified: 2009-02-19 20:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
xml file from the corrupted project (1004 bytes, text/xml)
2008-10-24 13:32 UTC, Egor Ushakov
Details
full project (37.50 KB, application/x-tar)
2008-10-28 09:46 UTC, Egor Ushakov
Details
another corrupted project (15.44 KB, application/x-compressed)
2008-10-28 10:59 UTC, Egor Ushakov
Details
another corrupted project (556.00 KB, application/x-tar)
2008-10-28 15:11 UTC, Egor Ushakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2008-10-24 13:32:01 UTC
For some reason one of my old projects become corrupted and now I get "Errors while reading XML from Application_1"
every time I open this project. The problem seem to be in corrupted configurations.xml which contains empty <confs>
block i.e. project has no configurations. I do not know why and how it happened (for sure I did not remove
configurations by hand from the xml file :) Now I'm unable to create a new configuration in this project: when I go to
project properties I get the exception:
java.lang.IllegalArgumentException: setSelectedIndex: 0 out of bounds
	at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:603)
	at org.netbeans.modules.cnd.makeproject.ui.customizer.MakeCustomizer.<init>(MakeCustomizer.java:144)
	at org.netbeans.modules.cnd.makeproject.api.MakeCustomizerProvider.showCustomizerWorker(MakeCustomizerProvider.java:175)
	at org.netbeans.modules.cnd.makeproject.api.MakeCustomizerProvider.access$000(MakeCustomizerProvider.java:76)
	at org.netbeans.modules.cnd.makeproject.api.MakeCustomizerProvider$1.run(MakeCustomizerProvider.java:119)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Comment 1 Egor Ushakov 2008-10-24 13:32:59 UTC
Created attachment 72594 [details]
xml file from the corrupted project
Comment 2 soldatov 2008-10-27 15:53:22 UTC
Because We doesn't know reason, bug can't be fixed in 6.5FCS
Comment 3 Thomas Preisler 2008-10-27 20:59:50 UTC
The attachment is not working for me. Please re-attach the project (not just the xml file).
Comment 4 Egor Ushakov 2008-10-28 09:46:15 UTC
Created attachment 72737 [details]
full project
Comment 5 Egor Ushakov 2008-10-28 10:59:10 UTC
same thing reproduced on Windows
Comment 6 Egor Ushakov 2008-10-28 10:59:48 UTC
Created attachment 72751 [details]
another corrupted project
Comment 7 Egor Ushakov 2008-10-28 15:10:42 UTC
I get it almost every day even with new projects...
Rasing priority to P2.
Comment 8 Egor Ushakov 2008-10-28 15:11:59 UTC
Created attachment 72781 [details]
another corrupted project
Comment 9 Thomas Preisler 2008-10-28 18:48:08 UTC
The configuration block is empty:

  <projectmakefile>Makefile</projectmakefile>
  <confs>
  </confs>

It can only happen if configuration size is zero (!) in the code below (CommonConfigurationXMLCodec.java):

308 Configurations confs = projectDescriptor.getConfs();
309 for (int i = 0; i < confs.size(); i++) {

and I don't understand how this can happen.

Questions:
1) Is it reproducible?
2) What steps leads up to this?

It could be some kind of a race condition. I will ask Alexander S. for an evaluation. He has recently reworked how projectdescriptor get read.
Comment 10 Thomas Preisler 2008-10-28 19:35:41 UTC
One more question:

3) Any exceptions in log file?
Comment 11 Leonid Lenyashin 2008-10-28 19:45:43 UTC
Thomas, could you please evaluate this issue for showstopper status.
Comment 12 Alexander Simon 2008-10-28 20:30:25 UTC
IMHO it is a bug in 7.0
To check my guess try to reproduce bug in RC1
Comment 13 Egor Ushakov 2008-10-29 09:02:02 UTC
Answers to questions:
1) Is it reproducible?
  No, it happens from time to time
2) What steps leads up to this?
  Create a project, then do usual thing - debug, change something, then close and open IDE
3) Any exceptions in log file?
  None
Comment 14 Alexander Simon 2008-10-29 10:50:24 UTC
See steps in 151685.
Create new file in project in first 9 seconds after creating. NPE:
SEVERE [org.openide.util.RequestProcessor]
java.lang.NullPointerException
        at
org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider.recordMetrics(ConfigurationDescriptorProvider.java:238)
        at org.netbeans.modules.cnd.makeproject.configurations.ConfigurationXMLReader._read(ConfigurationXMLReader.java:195)
        at org.netbeans.modules.cnd.makeproject.configurations.ConfigurationXMLReader$1.run(ConfigurationXMLReader.java:112)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

So all actions items that use configuration descriptor should check ConfigurationDescriptorProvider.gotDescriptor()
Comment 15 Alexey Vladykin 2008-10-29 19:18:47 UTC
With the assertion added to ConfigurationXMLWriter (line 74) it is impossible to create new project now. I get the
assertion every time I try to create a project. The project is not initialized correctly, it's empty and can only be closed.
Comment 16 Quality Engineering 2008-10-30 04:59:52 UTC
Integrated into 'main-golden', will be available in build *200810300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6fa8ce9f97d2
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing: IZ#151273:Corrupted configurations.xml
Comment 17 Alexander Simon 2008-10-30 15:21:50 UTC
Changes for IZ#146696 was rolled back.
It fixed the bug.