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 49752 - Beta 2 - NPE selecting Project Main Class
Summary: Beta 2 - NPE selecting Project Main Class
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-30 18:13 UTC by martinm1000
Modified: 2004-10-01 17:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log - Exceptions stack trace (44.55 KB, text/plain)
2004-09-30 18:14 UTC, martinm1000
Details
My first messages.log - where the corruption might have started (11.71 KB, application/zip)
2004-09-30 22:52 UTC, martinm1000
Details

Note You need to log in before you can comment on or make changes to this bug.
Description martinm1000 2004-09-30 18:13:05 UTC
NB 4 Beta 2 under jdk 1.5, using ANT Project

Can't select main class to run the project,
NullPointerException in J2SEProjectUtil.java:106
Comment 1 martinm1000 2004-09-30 18:14:53 UTC
Created attachment 17954 [details]
messages.log - Exceptions stack trace
Comment 2 _ ttran 2004-09-30 20:41:23 UTC
MDR storage is badly corrupted

See also
http://www.javalobby.org/thread.jspa?messageID=91812571&threadID=14723&forumID=61
Comment 3 martinm1000 2004-09-30 21:50:31 UTC
Thanks, you were right. I deleted the cache and everything seems ok.
Tested with Beta 2 under 1.4.2 and 1.5.0

Just a hint about the possible cause; On my first installation, I was
using jdk 1.5.0 as the default. In my projects settings, I created a
new target platform for 1.4.2. Maybe something happened here...

But this time its ok !
Comment 4 _ ttran 2004-09-30 22:05:37 UTC
No, no.  It's not fixed.  We can't really tell users "if things run
amok, please try to delete the mdr storage".  We have to make it robust

REOPEN
Comment 5 martinm1000 2004-09-30 22:52:40 UTC
Created attachment 17959 [details]
My first messages.log - where the corruption might have started
Comment 6 Martin Matula 2004-10-01 15:56:36 UTC
The problem seems to be caused by a bug in sources scanning mechanizm.
It was not robust enough to recover from an inconsistency that might
be caused most likely by a hard-exit from the IDE. From the
stacktraces in the log it seems that you did a hard exit (e.g. using
Ctrl+C) which caused that the indexes were not saved and the metadata
database remained in an inconsistent state (based on the informational
FileNotFoundExceptions and StorageException that were in the log).
While we are able to recover from most of the inconsistencies, you
uncovered an inconsistency we were not able to recover from. I've
fixed this today:
Checking in src/org/netbeans/modules/javacore/JMManager.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v
 <--  JMManager.java
new revision: 1.58; previous revision: 1.57
done

The fix should appear in the next daily build.
Comment 7 martinm1000 2004-10-01 16:23:24 UTC
Yep, I had to kill Netbeans... but only because at one time when I
switched some JDK configuration it wanted to rescan the classpaths...
and all got was Exceptions everywhere; It was impossible to exit NB
correctly; - So I think that the problem started before I killed NB...

Anyways, we'll see... !

Comment 8 Martin Matula 2004-10-01 17:14:28 UTC
You are right. There was another problem which I was able to identify
based on the second messages.log you provided in a zip file. Thanks a
lot! This issue was quite severe. I have fixed it:

Checking in
src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/BtreeDatabase.java;
/cvs/mdr/src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/BtreeDatabase.java,v
 <--  BtreeDatabase.java
new revision: 1.20; previous revision: 1.19
done
Checking in
src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/MDRCache.java;
/cvs/mdr/src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/MDRCache.java,v
 <--  MDRCache.java
new revision: 1.9; previous revision: 1.8
done