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 119883 - NullPointerException at org.netbeans.modules.derby.api.DerbyDatabases.extractSampleDatabase
Summary: NullPointerException at org.netbeans.modules.derby.api.DerbyDatabases.extract...
Status: RESOLVED WORKSFORME
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Vancouvering
URL: http://statistics.netbeans.org/except...
Keywords:
: 93954 120817 (view as bug list)
Depends on:
Blocks: 121195
  Show dependency tree
 
Reported: 2007-10-24 11:05 UTC by ernonieminen
Modified: 2008-08-05 17:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 4121


Attachments
stacktrace (601 bytes, text/plain)
2007-10-24 11:05 UTC, ernonieminen
Details
Messages.log after null pointer exception at startup (24.06 KB, text/plain)
2007-10-25 08:22 UTC, ernonieminen
Details
uigestures log (28.56 KB, application/octet-stream)
2007-10-30 12:44 UTC, ernonieminen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernonieminen 2007-10-24 11:05:10 UTC
Build: NetBeans IDE 6.0 Beta 2 (Build 200710212201)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
I stated the NetBeans IDE 6.0 beta 2 for the first time and this exception occurred.
Comment 1 ernonieminen 2007-10-24 11:05:16 UTC
Created attachment 51563 [details]
stacktrace
Comment 2 David Vancouvering 2007-10-24 16:58:31 UTC
Hi, John.  Can you take a look at this?  I suspect we need more information...
Comment 3 John Baker 2007-10-24 18:30:00 UTC
could you please attach the messages.log
in $system.home/.netbeans/6.0beta2/var/log/messages.log
Comment 4 ernonieminen 2007-10-25 08:22:20 UTC
Created attachment 51648 [details]
Messages.log after null pointer exception at startup
Comment 5 Andrei Badea 2007-10-25 14:21:56 UTC
*** Issue 93954 has been marked as a duplicate of this issue. ***
Comment 6 John Baker 2007-10-27 07:35:59 UTC
The system home directory is a UNC path ?

\\Ettresrv5\users\ett09241\redirect2

I suppose this is a supported home directory
Comment 7 John Baker 2007-10-27 08:10:18 UTC
Is NetBeans installed on the machine, Ettresrv5 or is this a remote machine?
Comment 8 ernonieminen 2007-10-29 07:38:31 UTC
NetBeans is installed on this computer that I am using. We have some system that our home directories are replicated to
the server (supposed to make things easier, but is quite annoying for me). This home directory is mapped as a drive Z,
but I think all the programs get UNC -path if they are trying to use the users home directory.
Comment 9 David Vancouvering 2007-10-29 19:25:50 UTC
I will try to reproduce this with a clean download of beta2
Comment 10 David Vancouvering 2007-10-29 20:32:48 UTC
Hi.  I can't reproduce this.  Can you provide me more information about exactly what you did?

In your userdir, there *may* be a gestures log, at /var/log/uigestures.  If that's there, can you attach it please. 
Thanks. 
Comment 11 ernonieminen 2007-10-30 12:44:51 UTC
Created attachment 51997 [details]
uigestures log
Comment 12 ernonieminen 2007-10-30 12:52:01 UTC
I attached the uigestures log. The exception occurred when first time starting the NetBeans 6.0 beta 2. I noticed the
red dot at the lower right hand corner of the UI and clicked it to see what has happened. The exception was listed there
and I pressed the submit (or something, can't remember the text) button and the NetBeans reported this issue
automatically. This is all that I can tell you about what I did. I did though have problems installing the NB6 (Issue
119861) so I don't know if this issue is related to that, but I guess it is a long shot.
Comment 13 David Vancouvering 2007-10-31 18:18:23 UTC
Hi, Erno.  I looked at the code where the stack trace occurred, and I must admit I am stumped.  Basically the logic is
like this:

- Find out what the database directory is for Java DB
- If it does not exist, create it
- Return a Java File object for that directory
- Create a NetBeans FileObject for that file, which we are sure exists from above
- The method toFileObject() that does the above returns null.  According to the javadoc for this method [1], this should
only return null if the file doesn't exist !?!

A thread from Jesse Glick [2] seems to indicate that if your "masterfs is not present" whatever that means, then
toFileObject() will return null.  Given that you had trouble installing NB, I wonder if this is a side effect?  Could
you try (I know, I know, common support request) reinstalling?

Before reinstalling, one thing you could do is check what the Java DB database location is set to, see Tools->Java DB
Database->Settings and see what Database Location is set to.  Try setting it to a valid directory and see if your error
goes away.

[1]
http://bits.nbextras.org/dev/javadoc/org-openide-filesystems/org/openide/filesystems/FileUtil.html#toFileObject(java.io.File)

[2] http://www.nabble.com/FileUtil.toFileObject()-returns-null-t2564218.html

Comment 14 David Vancouvering 2007-11-01 04:43:44 UTC
Sorry, that's ConnectAction.java, not ConnectionAction.java
Comment 15 ernonieminen 2007-11-01 10:19:09 UTC
I will try to re-install today. Location for the Java DB is \\Ettresrv5\users\ett09241\redirect2\.netbeans-derby. I
think that I hasn't made this clear before, but I got this exception only once when first time starting the NetBeans.
Comment 16 ernonieminen 2007-11-01 11:22:58 UTC
I re-installed NetBeans and did not get that same exception again.
Comment 17 Andrei Badea 2007-11-01 13:28:58 UTC
> A thread from Jesse Glick [2] seems to indicate that if your "masterfs is not present"
> whatever that means, then toFileObject() will return null

By "masterfs" Jesse meant the Master Filesystem module (in openide/masterfs), basically a FileSystem implementation
corresponding to the local file system. It is unlikely NetBeans would start at all without this module on the classpath,
so that's unlikely the cause of this NPE.
Comment 18 David Vancouvering 2007-11-01 13:31:59 UTC
OK, then I think we can mark this issue as fixed.
Comment 19 Petr Blaha 2007-11-01 15:22:02 UTC
*** Issue 120817 has been marked as a duplicate of this issue. ***
Comment 20 David Vancouvering 2007-11-01 17:46:13 UTC
I am reopening as another user is encountering the same problem.  I am going to ask him for his message log too.  I
wonder if it has to do with the fact that the Java DB location is on a UNC path
(\\Ettresrv5\users\ett09241\redirect2\.netbeans-derby).  I could imagine, for instance, that the network connection is
flaky, so that we are able to create the directory, but when in the next instant we try to open a FileObject the
networking protocol says the directory doesn't exist.

I'm going to ask the other user to specify where their Java DB database directory is, and see if it's also a UNC path.
Comment 21 David Vancouvering 2007-11-01 17:49:35 UTC
Adding romeriz so we can keep all the dialog on a single issue.
Comment 22 David Vancouvering 2007-11-01 17:51:11 UTC
As I mentioned in issue 120817, I asked romeriz to let me know what the value is for the Java DB database directory. 
I'm curious to see if it's also a remote file system.
Comment 23 David Vancouvering 2007-11-08 16:54:53 UTC
No response from Romeriz.  This can probably be tested by putting the userdir on a UNC path.
Comment 24 John Baker 2007-11-09 00:09:36 UTC
*** Issue 121455 has been marked as a duplicate of this issue. ***
Comment 25 John Baker 2007-11-09 07:35:12 UTC
See also 46813

Looks like one or more workarounds mentioned in 46813, such as desc36, may help resolve this issue
Comment 26 David Vancouvering 2007-11-10 04:21:29 UTC
I just saw there is a very old bug, where UNC paths are not supported.  The workaround is to change your userdir to be a
non-UNC path.

Closing this as a duplicate...

*** This issue has been marked as a duplicate of 46813 ***
Comment 27 John Baker 2007-11-27 02:36:02 UTC
Not always the case the that Derby system home is a UNC path.
This NPE can be reproduced by deleting .netbeans-derby and restarting the IDE (not necessarily a valid use case).

However, what needs to be investigated is why .netbeans-derby does not get created on disk

In DerbyDatabases.extractSampleDatabase(...) line 323
FileUtil.toFileObject(systemHomeFile); will return null if systemHomeFile is not found on disk.

Comment 28 David Vancouvering 2008-01-09 19:37:25 UTC
Works for John...
Comment 29 David Vancouvering 2008-01-09 19:38:55 UTC
The last action was for another bug, sorry about that.
Comment 30 Exceptions Reporter 2008-04-22 20:57:56 UTC
This issue has already 20 duplicates 
Comment 31 David Vancouvering 2008-04-22 21:36:53 UTC
I am upgrading this to a P2 because it keeps happening.  If anybody is able to reliably reproduce, please let me know.
Comment 32 Andrei Badea 2008-04-25 12:56:14 UTC
But the issue is still incomplete... there even isn't a recent stack trace!
Comment 33 Exceptions Reporter 2008-07-07 16:31:52 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=4121
Comment 34 David Vancouvering 2008-08-05 17:23:47 UTC
Closing because we don't have enough information to reproduce.