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 32698 - NPE while mount a view without a vob
Summary: NPE while mount a view without a vob
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: -S1S-
Hardware: Sun Windows ME/2000
: P1 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-07 21:19 UTC by pcmreddy
Modified: 2003-04-16 19:45 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The context diff, that fix this problem. (2.05 KB, patch)
2003-04-08 18:13 UTC, Martin Entlicher
Details | Diff
The binary patch, that fix this problem. Put into <NB-install>/modules/autoload/patches/org-netbeans-modules-vcscore/ folder. (19.53 KB, application/octet-stream)
2003-04-08 18:19 UTC, Martin Entlicher
Details
Output to the first Refresh (490 bytes, text/plain)
2003-04-09 12:47 UTC, dmladek
Details
Second Refresh data-output (2.49 KB, text/plain)
2003-04-09 12:51 UTC, dmladek
Details
my ide.log with FNFE & org.w3c.dom.DOMException stacktraces (125.52 KB, text/plain)
2003-04-09 14:21 UTC, dmladek
Details
The whole context diff, that fix this problem. (5.72 KB, patch)
2003-04-10 09:46 UTC, Martin Entlicher
Details | Diff
The binary patch for vcscore module. Put into <NB-install>/modules/autoload/org-netbeans-modules-vcscore/ folder. (81.12 KB, application/octet-stream)
2003-04-10 10:00 UTC, Martin Entlicher
Details
Binary patch for cvs-profile module. Put into <NB-install>/modules/patches/org-netbeans-modules-vcs-profiles-cvsprofiles/ folder. (14.04 KB, application/octet-stream)
2003-04-10 10:03 UTC, Martin Entlicher
Details
Context patch for the last change in VcsAttributes. (1.32 KB, patch)
2003-04-10 11:43 UTC, Martin Entlicher
Details | Diff
The binary patch for the last change in VcsAttributes. Put into <NB-install>/modules/autoload/patches/org-netbeans-modules-vcscore/ folder. (9.50 KB, application/octet-stream)
2003-04-10 11:45 UTC, Martin Entlicher
Details
The full context diff of all the changes, that fix this bug. (10.85 KB, patch)
2003-04-11 12:01 UTC, Martin Entlicher
Details | Diff
The new binary patch for vcscore module. Put this into <NB-install>\modules\autoload\patches\org-netbeans-modules-vcscore\ folder instead of the old patches. Use together with the Patch32698_cvs-profile.jar. (70.49 KB, application/octet-stream)
2003-04-11 12:12 UTC, Martin Entlicher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pcmreddy 2003-04-07 21:19:31 UTC
Create a ClearCase dynamic view on windows. (Do
not mount vob in this view)Mount ClearCase file
system in IDE by selecting previously created view.

IDE should handle NPE properly. IDE may provide a
dialog box with propermessage.

Observe the following exception from IDE.

 Annotation: Exception occurred in Request Processor^M
java.lang.NullPointerException^M
	at
org.netbeans.modules.vcscore.caching.VcsCache.lookupCacheDir(VcsCache.java:382)^M
	at
org.netbeans.modules.vcscore.caching.VcsCache.initCacheDir(VcsCache.java:420)^M
        at
org.netbeans.modules.vcscore.caching.VcsCache.getCacheFile(VcsCache.java:282)^M
        at
org.netbeans.modules.vcscore.cache.CacheHandler.getCacheFile(CacheHandler.java:237)^M
	at
org.netbeans.modules.vcscore.cache.CacheHandler.getCacheFile(CacheHandler.java:222)^M
	at
org.netbeans.modules.vcscore.cache.CacheHandler.createReference(CacheHandler.java:142)^M
	at
org.netbeans.modules.vcscore.caching.VcsFSCache.createReference(VcsFSCache.java:372)^M
	at
org.netbeans.modules.vcscore.VcsFileSystem.children(VcsFileSystem.java:3073)^M
        at
org.openide.filesystems.DefaultAttributes.children(DefaultAttributes.java:152)^M
	at
org.openide.filesystems.AbstractFileObject.list(AbstractFileObject.java:75)^M
        at
org.openide.filesystems.AbstractFolder.refreshFolder(AbstractFolder.java:627)^M
        at
org.openide.filesystems.AbstractFolder.refresh(AbstractFolder.java:795)^M
    	at
org.openide.filesystems.AbstractFileObject.refresh(AbstractFileObject.java:702)^M
	at
org.openide.filesystems.AbstractFileObject.refresh(AbstractFileObject.java:683)^M
	at
org.openide.filesystems.AbstractFolder.check(AbstractFolder.java:531)^M
  	at
org.openide.filesystems.AbstractFolder.find(AbstractFolder.java:224)^M
 	at
org.openide.filesystems.AbstractFileSystem.find(AbstractFileSystem.java:125)^M
        at
org.openide.filesystems.Repository.find(Repository.java:396)^M
	at
org.netbeans.modules.debugger.support.java.BreakpointUpdater.refreshFileObjectListener(BreakpointUpdater.java:231)^M
	at
org.netbeans.modules.debugger.support.java.BreakpointUpdater.fileSystemsAdded(BreakpointUpdater.java:363)^M
	at
org.netbeans.modules.debugger.support.java.BreakpointUpdater$LazyRepositoryListener.run(BreakpointUpdater.java:527)^M
	at org.openide.util.Task.run(Task.java:136)^M
	at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:328)^M
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:670)^M
Comment 1 pcmreddy 2003-04-07 23:19:00 UTC
As this is not affecting data  I am changing priority of this bug to P2.
Comment 2 Martin Entlicher 2003-04-08 12:59:23 UTC
This is not a problem in the ClearCase profile, it's a bug in vcscore
module in the file status caching system.

Is this reproducible? It seems like the parent file of the refreshed
object is not found. So perhaps the view is directly some drive
letter?
Comment 3 Martin Entlicher 2003-04-08 13:33:31 UTC
This bug seems to be generic for all VCS profiles. If you define your
working directory as just a drive letter, this exception is thrown.
Moreover a corrupted filesystem is stored in
system/Projects/Default/system/Mount, which cause some exceptions
being thrown after restart of the IDE.
Comment 4 Martin Entlicher 2003-04-08 15:49:59 UTC
I suggest this to be P1. Any comments from QA? I've found the IDE not
to be much stable after trying to mount a letter drive.
Also it's not possible to use working directories like "D:\" not only
in ClearCase, but not in CVS as well.

Comment 5 dmladek 2003-04-08 16:55:32 UTC
It is difficult to say...

I don't think that mounting a DRIVE root is a common user scenarion
(and on Windows exist possibillity to mount a drive into a dir).
So for that reason it is not IMHO stopper.

For CC users it might be a problem 'cause AFAIK they mount root of
DRIVE....


And there is still question about affectiong data this situation:
If you try it eg. with CVS profile, then it seems corrupt your
$user_dir and to get rid of various E. you might have to delete yours
$user_dir.
This sound like a reason for making it as a showstopper
-------------------------------------------------------------

->to PCM Reddy:
Would you be so kind and write us your oppenion about common user
scenario of ClearCase user on Windows
And if then it nothing corrupt? 

Thanks
-daniel

Comment 6 pcmreddy 2003-04-08 17:59:55 UTC
This will happen to most of the users who uses ClearCase Dynamic
views. This is a vitual drive letter created by clearcase dynamic view
on windows. This is not a physical drive in windows box. This bug will
appear to a common user. We may need to provide a nice dialog box in
place of NPE.
Comment 7 dmladek 2003-04-08 18:07:30 UTC
Thanks,

so that sees it is showstopper for you (or CC users) :-(
Then we should increase the priority to P1...
Comment 8 Martin Entlicher 2003-04-08 18:11:21 UTC
The problem is fixed in the main trunk. The fix is simple, we must
take into account, that the parent directory may not exist:

/cvs/vcscore/src/org/netbeans/modules/vcscore/cache/CacheDir.java,v 
<--  CacheDir.java
new revision: 1.33; previous revision: 1.32
/cvs/vcscore/src/org/netbeans/modules/vcscore/caching/VcsCache.java,v 
<--  VcsCache.java
new revision: 1.57; previous revision: 1.56

Comment 9 Martin Entlicher 2003-04-08 18:13:18 UTC
Created attachment 9784 [details]
The context diff, that fix this problem.
Comment 10 Martin Entlicher 2003-04-08 18:19:54 UTC
Created attachment 9785 [details]
The binary patch, that fix this problem. Put into <NB-install>/modules/autoload/patches/org-netbeans-modules-vcscore/ folder.
Comment 11 Martin Entlicher 2003-04-08 18:21:52 UTC
PCM Reddy, can you please verify the issue with the attached binary
patch? Thanks.

Adding to cc Peter Wisnovsky so that he is aware of this issue.
Comment 12 dmladek 2003-04-08 18:26:54 UTC
I'll also take a look at this patch on my Win XP. But till tomorrow...
Comment 13 dmladek 2003-04-09 12:11:50 UTC
Martin, it's GREAT!
No exception, etc... and other restriction for mounting
just my DRIVE as a working.

But, I didn't satisfy just with smooth mounting, 
I also check briefly some functionality, and I found problems
in Refresh recursively and there might be possible others problem for
rest of commands....

So, my summary is:
==================
patch is good, but because of fixing this problem
I would have discovered others bugs...
I'm not going to enter new one, but rather reopening it
(if you agree:)
Comment 14 dmladek 2003-04-09 12:42:43 UTC
Reproduction:
==============

I copied a content of one my working directory to the empty 
partition labeled E:

Then I Started CVS Mounting Wizard (common for j-cvs and g-cvs)

As a working dir I chose E:\
Everything next was recognized and I only chose I wish to use cmd-line
client.

In my mounted G-CVS FS I could see just everything as it was on my
disk E:\

When I expanded nodes lots of them were [local]
So I decided to perform Refresh Recursively

And troubles begin:-(
=====================
After refresh finished, all nodes in the FS were collapsing
and recollapsing (don't know how to better describe)
But there were then at least twice more nodes in a root of FS than it
was physicaly in my drive E:\

Normal refresh on the root of FS will repair it and RefRec.
will break it again....


Here is Execution String:
cmd /X /C "cd /D \"e:\\\\.\"&&   \"C:\space\cvs\cvs.exe\" -d
\":pserver:anoncvs@fortecvs:/nbextra\" -f status -R "

I'm attaching Ref.Rec.outputs
Comment 15 dmladek 2003-04-09 12:47:44 UTC
Created attachment 9800 [details]
Output to the first Refresh
Comment 16 dmladek 2003-04-09 12:50:42 UTC
The second refresh Executing String:
org.netbeans.modules.vcs.profiles.cvsprofiles.list.CvsListRecursiveCommand.class
LIST_SUB_STATUS_CMD LIST_SUB_LOG_CMD

see following attachment of its output
Comment 17 dmladek 2003-04-09 12:51:21 UTC
Created attachment 9801 [details]
Second Refresh data-output
Comment 18 dmladek 2003-04-09 14:19:23 UTC
Oups:-///
There is another problem:
Seems that something is then corrupted in your $user_dir
You've got Es. when mounting another FS:
org.w3c.dom.DOMException: Wrong root element: brokenDocument
and
java.io.FileNotFoundException: Relative path: F: Which is printed only
into ide.log when mounting the first FS

This could never occure without this patch.

reproduction:
=============
1)
Just for aussuring the correct and reliable functionality
Mount G-CVS FS to a working dir which is not your root of a drive.
E.g.: F:\myworkingDir1\
Perform there some normal and Recursive refreshes.
Everything till now is right.

2)
Mount G-CVS FS to your root of drive. E.g: E:\
Perform normal and Recursive and normal Refresh

3)
Unmount first FS

4)
Mount G-CVS FS axactly the same way you mount first FS
When you get to the point of choosing profile and choose
one, you will get an exception:
org.w3c.dom.DOMException: Wrong root element: brokenDocument

I'm gonna attach the whole ide.log
with stacktraces of all E.
Comment 19 dmladek 2003-04-09 14:21:54 UTC
Created attachment 9808 [details]
my ide.log with FNFE & org.w3c.dom.DOMException stacktraces
Comment 20 Martin Entlicher 2003-04-09 18:19:00 UTC
At least the Refresh Recursively now works correctly. I'm still
exploring the problem with loading of VCS profiles.

/cvs/vcsgeneric/profiles/cvsprofiles/src/org/netbeans/modules/vcs/profiles/cvsprofiles/list/CvsListRecursiveCommand.java,v 
<--  CvsListRecursiveCommand.java
new revision: 1.9; previous revision: 1.8
Comment 21 Martin Entlicher 2003-04-10 09:38:01 UTC
I've finally found where is the problem. On some systems (like
Windows) if you remove the last File.separator from the file path you
can corrupt the path! Like "D:\" must be kept with the last backslash,
"D:" is not a valid path.
This bug makes the whole IDE unstable, because FileUtil.toFile()
produces bad results.

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v 
<--  VcsFileSystem.java
new revision: 1.220; previous revision: 1.219
Comment 22 Martin Entlicher 2003-04-10 09:46:43 UTC
Created attachment 9829 [details]
The whole context diff, that fix this problem.
Comment 23 Martin Entlicher 2003-04-10 10:00:29 UTC
Created attachment 9831 [details]
The binary patch for vcscore module. Put into <NB-install>/modules/autoload/org-netbeans-modules-vcscore/ folder.
Comment 24 Martin Entlicher 2003-04-10 10:03:37 UTC
Created attachment 9832 [details]
Binary patch for cvs-profile module. Put into <NB-install>/modules/patches/org-netbeans-modules-vcs-profiles-cvsprofiles/ folder.
Comment 25 Martin Entlicher 2003-04-10 10:06:29 UTC
Please test *all* CVS commands (it would be good to have also PVCS,
VSS and ClearCase commands tested) in the root of FS mounted at a
letter (e.g. "G:\") in Windows. Thanks.
Comment 26 Tomas Pavek 2003-04-10 10:35:57 UTC
The diff looks ok for me. See no problem to integrate it  after
verifying by QA.
Comment 27 Martin Entlicher 2003-04-10 11:40:07 UTC
Further check added to VcsAttributes in the main trunk:

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsAttributes.java,v 
<--  VcsAttributes.java
new revision: 1.27; previous revision: 1.26

Please let me know whether this is necessary for NB 3.5 / S1S 5.0 as
well. It checks whether the File returned from FS is absolute.
This is an add-on, that assures, that class loaders will work O.K., it
silently ignores files, that might be corrupted and can therefore
destabilize the whole IDE.

How to reproduce:
Mount a Generic FS and write just "blbost" into the Working Directory
textfield. Then try to execute some file via internal execution. Or
try to mount another Generic VCS filesystem.
Comment 28 Martin Entlicher 2003-04-10 11:43:49 UTC
Created attachment 9836 [details]
Context patch for the last change in VcsAttributes.
Comment 29 Martin Entlicher 2003-04-10 11:45:46 UTC
Created attachment 9837 [details]
The binary patch for the last change in VcsAttributes. Put into <NB-install>/modules/autoload/patches/org-netbeans-modules-vcscore/ folder.
Comment 30 dmladek 2003-04-10 17:59:13 UTC
IMHO: Martin, you've probably omited /patches/ in the path location
for your path:
2003-04-10 02:00 PDT: Patch32698_vcscore.jar

tha path had to be the same as for your another patch:
2003-04-10 03:45 PDT: Patch32698_2_vcscore.jar

which is:
<NB-install>/modules/autoload/patches/org-netbeans-modules-vcscore/
folder.
---------------------------------------------------------------------


I tested intensively all 3 last provided patches from you on win XP
using the same build as yesturday (with removed the previous patch)
only on G-CVS FS (CVS profile only)

I tested with basic cvs commands which works without problem...
But I found that file's statuses aren't actualizied according to their
real statuses :-(((

Maybe it somehow relates to the fact that I try to mount my working as
only:
 F:
not 
 F:\

so try to fix that user doesn't need choose drive by mouse, but s/he
could type it as simply as it is possible...

I'm sorry but I rather reopening it, but IMHO it's much better then it
was before;-)
Comment 31 dmladek 2003-04-10 18:08:05 UTC
and now to description of my situation:
=======================================
I create a text file NOT IN THE ROOT OF F:
but 3 levels deeper. All above was already exist (it was added&commited).
After ADD, File stay [local] in source editor and in the explorer, but
tooltip on hte file said [Locally Added]
and also IconBadging works fine;-) 
Then I commited this file. Still the same situation....
except tooltip and IB...

Previously I played on onther drive only with update, checkout,
refreses, merging... and in that case I didn't recognize any problems
with file statuses :-/

I just believe it is related to how the working drive is 
specified: if it is 'F:' or 'F:\'
But it is sound strange when I thinking more about it :-\
Comment 32 Martin Entlicher 2003-04-11 10:20:36 UTC
I'm working on further fixes:
- We will not allow to mount "E:" - only "E:\" can be mounted.
- file status changes are badly fired. Nobody has ever thought, that
root dir can end with File.separator, so every fired name has cut the
first letter.
Comment 33 Martin Entlicher 2003-04-11 10:35:03 UTC
Fixed (again) in NB 4.0:

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v 
<--  VcsFileSystem.java
new revision: 1.222; previous revision: 1.221

I'll attach new contextual and binary patches...
Comment 34 Martin Entlicher 2003-04-11 12:01:32 UTC
Created attachment 9871 [details]
The full context diff of all the changes, that fix this bug.
Comment 35 Martin Entlicher 2003-04-11 12:12:00 UTC
Created attachment 9872 [details]
The new binary patch for vcscore module. Put this into <NB-install>\modules\autoload\patches\org-netbeans-modules-vcscore\ folder instead of the old patches. Use together with the Patch32698_cvs-profile.jar.
Comment 36 dmladek 2003-04-11 13:55:01 UTC
Well I tested on todays NB3.5Beta
  Product Version       = NetBeans IDE 3.5 Beta (Build 200304102350)
  IDE Versioning        = IDE/1 spec=3.42.1 impl=200304102350
  Operating System      = Windows XP version 5.1 running on x86
  Java; VM; Vendor      = 1.4.2-beta; Java HotSpot(TM) Client VM
1.4.2-beta-b19; Sun Microsystems Inc.
  Java Home             = C:\Program Files\Java\j2sdk1.4.2\jre
  System Locale; Encod. = en_GB; Cp1252
  Home Dir; Current Dir = C:\Documents and Settings\dm103276;
C:\space\NetBeans IDE 3.5beta
  IDE Install; User Dir = C:\space\NetBeans IDE 3.5beta; C:\Documents
and Settings\dm103276\.netbeans\3.5beta
============================================================
and I think, it's getting better and better ;-)

Yes, IHMO, it is fixed and never could happen to user any damage on
his usr_dir, no E. is thrown, file statuses are working correctly now,
etc.

So, QA say: go ahead and fix it, please!!! :-)

-------------------------------------------------------------
But anyway, with this fix I discovered previously hidden P1 bug which
I consider as a new showstopper for NB3.5/Nevada:-(((
I'm going to enter it against vcsgeneric 'cause it is relatid to
vcs-profiles and it is about that basic cvs commands, such co, up and
prob ably import doesn't work

(I''ll let you know the ussue no. here)
Comment 37 dmladek 2003-04-11 14:10:43 UTC
So, the no. is: issue #32828
Comment 38 Richard Gregor 2003-04-11 14:44:56 UTC
Code reviewed without objections.
Comment 39 _ ttran 2003-04-11 15:15:20 UTC
approved for 3.5 
Comment 40 Martin Entlicher 2003-04-11 16:07:13 UTC
Thanks for the review, verification and approval.
The fix is merged into release35 branch:

Checking in cache/CacheDir.java;
/shared/data/helm/cvs/repository/vcscore/src/org/netbeans/modules/vcscore/cache/CacheDir.java,v 
<--  CacheDir.java
new revision: 1.32.2.1; previous revision: 1.32
Checking in caching/VcsCache.java;
/shared/data/helm/cvs/repository/vcscore/src/org/netbeans/modules/vcscore/caching/VcsCache.java,v 
<--  VcsCache.java
new revision: 1.56.2.2; previous revision: 1.56.2.1
Checking in VcsFileSystem.java;
/shared/data/helm/cvs/repository/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v 
<--  VcsFileSystem.java
new revision: 1.207.2.11; previous revision: 1.207.2.10
Checking in VcsAttributes.java;
/shared/data/helm/cvs/repository/vcscore/src/org/netbeans/modules/vcscore/VcsAttributes.java,v 
<--  VcsAttributes.java
new revision: 1.22.36.6; previous revision: 1.22.36.5
Comment 41 Martin Entlicher 2003-04-11 16:23:33 UTC
One more merge to release35 ;-)

Checking in
src/org/netbeans/modules/vcs/profiles/cvsprofiles/list/CvsListRecursiveCommand.java;
/shared/data/helm/cvs/repository/vcsgeneric/profiles/cvsprofiles/src/org/netbeans/modules/vcs/profiles/cvsprofiles/list/CvsListRecursiveCommand.java,v 
<--  CvsListRecursiveCommand.java
new revision: 1.8.2.1; previous revision: 1.8