Bug 38970 - DataObject not recognized properly sometimes
DataObject not recognized properly sometimes
Status: RESOLVED FIXED
Product: serverplugins
Classification: Unclassified
Component: Infrastructure
3.x
PC Windows XP
: P1 (vote)
: 3.x
Assigned To: Pavel Buzek
issues@serverplugins
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-18 18:07 UTC by _ pcw
Modified: 2004-01-20 21:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo