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 38970

Summary: DataObject not recognized properly sometimes
Product: serverplugins Reporter: _ pcw <pcw>
Component: InfrastructureAssignee: Pavel Buzek <pbuzek>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P1    
Version: 3.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

Description _ pcw 2004-01-18 18:07:54 UTC
This bug is intermittant (but it is very common 
for me) and I haven't nailed down exact steps to 
reproduce.  Roughly, something like this:

1. Start IDE, create new web module.
2. Shutdown IDE (save anything that is asked 
about).
3. Start IDE - examine to see if sun-web.xml is 
represented as ConfigDataObject or XMLDataObject 
(you can tell by the glyph/icon representing it - 
blue = bad).
4. If sun-web.xml is bad (ie blue, or plain XML 
file), then there you go.  Otherwise, continue.
5. If sun-web.xml is ok (IE recognized as 
configuration), open web.xml in editor (don't 
type anything at all).
6. Shutdown and restart IDE.
7. Examine sun-web.xml again, as in step 4.  If 
it's still good, well, you can try step 6 a 
couple of times to see if it goes bad.  You can 
also try editing the sun-web.xml configuration 
(change context root or something and leave it 
open).  Like I said, I'm not exactly sure how to 
reproduct it 100%.  You can "reset" to start over 
by deleting sun-web.xml and starting over at step 
1.

I was able to catch it in the debugger after a 
bit of tinkering though and I can say what is 
wrong:

In ConfigurationStorage.getStorage() (at line 
#106 as of 1/17 @ 17:26 GMT), the line of code to 
retrieve the file object for the config file says:

FileObject fos [] = FileUtil.fromFile (f);

In the bad case, this result has length two and 
the first FileObject (the one always used) 
returns an XMLDataObject at line 160 further down 
where the data object is retrieved.

In the good case, the result also has length two 
but the first FileObject returns a 
ConfigDataObject at line #160.
Comment 1 Pavel Buzek 2004-01-20 21:46:48 UTC
Peter, what you found in debugger was a result of the bug, not the
cause. The code was very fragile and there was number of problems.
Using instance variables in SharedClassObject (loader), calling code
that need the IDE fully initialized from loader (very early in
startup), etc. Hope it is more robust now.