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 119742 - [60cat] NPE while saving content of renamed sun-web.xml
Summary: [60cat] NPE while saving content of renamed sun-web.xml
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-23 10:42 UTC by jlaskowski
Modified: 2007-10-25 01:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE stack trace (761 bytes, text/plain)
2007-10-23 10:43 UTC, jlaskowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jlaskowski 2007-10-23 10:42:31 UTC
[ BUILD # : 200710211200 ]
[ JDK VERSION : 1.6.0_02 ]

1. Create a webapp
2. Change sun-web.xml to geronimo-web.xml (the file will disappear
from Configuration Files node in Projects window)
3. Go to Files window > web/WEB-INF directory and open
geronimo-web.xml
4. Change its content to any valid XML.
5. Upon save NPE's thrown. See the attachment.
Comment 1 jlaskowski 2007-10-23 10:43:05 UTC
Created attachment 51473 [details]
NPE stack trace
Comment 2 _ pcw 2007-10-23 23:47:09 UTC
Cannot reproduce (on Solaris x86, but OS should not matter).

There is no rename for this file type (sun-web.xml) inside the IDE that I'm aware of, so exactly what actions did you
take that correspond to your step 2 (Change sun-web.xml to geronimo-web.xml)?

I renamed the file from a command prompt and upon refocusing the IDE, it was clear that not only had the file been
renamed, but that a new DataLoader had loaded it since the icon was different (This is what should happen).

The exception you describe implies that somehow the renamed file was not reloaded with the correct loader and that could
certainly cause problems.  But I don't see how that could ever happen.
Comment 3 jlaskowski 2007-10-24 22:39:50 UTC
I could reproduce it very easily in Beta 2, too. The rename feature is simple F2 while the file's selected. That's the
step 2.
Comment 4 _ pcw 2007-10-25 00:25:34 UTC
Thanks.  Ok, I can reproduce this now.

The NPE is no big deal to fix, I'll fix that and enhance the error tracking a bit so it works similar to the way the
standard descriptors handle this (behavior of ejb-jar.xml is closest facimile).

The more interesting question is how renaming of these files is handled.  For the Sun DD files, renaming should cause
existing dataobjects to be destroyed and new dataloader and dataobject to be created, if necessary.  I suspect there are
other XML files that ought to be handled this way as well.
Comment 5 _ pcw 2007-10-25 01:31:12 UTC
Fixed NPE & error hint issues.  Whether rename should or shouldn't even be allowed here, I'll leave as a topic for
another day.