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 103128 - Add Diagram throws NullPointerException
Summary: Add Diagram throws NullPointerException
Status: RESOLVED INVALID
Alias: None
Product: uml
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: HP Windows XP
: P1 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-02 13:15 UTC by mikejwatts
Modified: 2007-05-04 10:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log file as requested in the error message box (18.56 KB, text/plain)
2007-05-02 13:16 UTC, mikejwatts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mikejwatts 2007-05-02 13:15:35 UTC
Right-click on diagrams node in the projects window and selecting Add Diagram
throws a NullPointerException
Comment 1 mikejwatts 2007-05-02 13:16:52 UTC
Created attachment 42043 [details]
messages.log file as requested in the error message box
Comment 2 mikejwatts 2007-05-02 14:07:30 UTC
Not sure whether this is related but after exiting the application I have lost
_all_ of my data - models and diagrams; not just the changes made during that
session.
Comment 3 Peter Lam 2007-05-02 18:46:51 UTC
I tried your scenario but could not reproduce. What uml project type
(java-platform or independent model) do you have? 

You might also want to restart your ide in a fresh ide userdir to see if it
helps. Once you restart your ide with new userdir, you'll have to open your
previous projects.
Comment 4 mikejwatts 2007-05-02 19:50:31 UTC
Thanks for your fast response.  I tried starting NetBeans as a different user 
( in order to use a fresh dir ) and a couple of things of interest: I now have 
a UML Modeling Menu item and lots of other UML submenu items ( although most 
go nowhere, presumably because I do not have a project open yet ).  I tried 
opening the project but when I first open the parent of the project dir I see 
the project 'hint' icon; when I clik on it the hint disappears and it won't 
let me open the project.

I think I set the type to Java [even though some of it won't be - part will be 
in Prolog, although I've never used that before - but that's a different story]

Not sure if its significant but the project was started as a model i.e. not 
from code and at the point I reached I still had not generated any code ( 
shame, 'cos I probably could have re-built a good proportion of my work from 
that ).
Comment 5 Yang Su 2007-05-02 21:48:00 UTC
The NPE was caused by missing model file that was generated when uml project was
created. Have you ever tried to open the file outside IDE, for example, double
clicking on the file from windows explorer? For historic reason, the file has
.etd extension ( a mistake that should be corrected ), Acrobat reader is invoked
by default to open the file, the reader will abort the loading due to wrong
format, of course, and remove the file. That seems to be the only possible
scenario if user didn't delete the file manually by mistake. BTW, user can view
the model file from IDE by navigating to file tab.

The entire model information is stored in that single file, diagram presentation
info is stored in .etld .etlp. Diagram will not render properly if corresponding
model elements cannot be retrieved.

The possible reason you cannot open existing uml project is that you probably
installed uml plugin into user dir as opposed to IDE installation dir (global
option), when you start IDE with another user dir, uml modules will not be
loaded, as a result, IDE cannot recognize the uml project type, so the project
icon disappears once project folder is selected.


Comment 6 Peter Lam 2007-05-02 22:27:19 UTC
Yeah, looks like it's the case that you installed the UML Module locally into
the ide userdir. In this case, you'll need to install the UML Module again in
order to be able to open the UML project, assuming your UML project is not
corrupted as sherylsu has indicated.
Comment 7 mikejwatts 2007-05-03 09:09:16 UTC
Ah - that Acrobat thing is scary - and that's exactly what happened.  I was 
looking at the raw files to see if I anything was suitable to extract and send 
to my superviser without her having to have the application installed that 
would show some of the underlying stuff, as much as anything just to show it 
was more than a few diagrams.  And I was wondering why the file was not in the 
list after I'd looked at it - I feel a bit stupid not to think about that a 
bit more at the time.  That's a nasty Acrobat habit too, in my opinion.  I'll 
pull the file out of my backup later today and let you know the outcome.

Thanks again for the responses.
Comment 8 artibee 2007-05-03 17:17:42 UTC
SergeyP suggested: use UML project's report ("Generate Model Report"
from project's context menu) to generate html representation of your
uml project if you want to send it to anyone who have no netbeans+uml.
Comment 9 mikejwatts 2007-05-04 10:20:41 UTC
Just want to report that replacing the .etd file from previous day's backup 
has restored the data to that point.  This means this should be changed from a 
defect in the software to a defect in the user ;-)  I have changed the 
association of .etd away from Adobe Acrobin, as I shall now dub it.

Thanks also for the hint on the HTML report generation... it was quite a 
surprise to see such a sophisticated feature - very nice indeed.