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.
Summary: | IllegalArgumentException: Was not listening to "some_path" | ||
---|---|---|---|
Product: | platform | Reporter: | kosmonaffft |
Component: | Filesystems | Assignee: | Jaroslav Tulach <jtulach> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | aldobrucale, athompson, atrav99, ehsavoie, fverhoef, ionuion, javydreamercsw, jrechtacek, lforet, lhochet, markiewb, mfriedenhagen, mienamoo, misterm, mkleint, mmirilovic, musilt2, pekarna, rptmaestro, sishbi, tboudreau, tim_sa, tzezula, wissenstein |
Priority: | P1 | ||
Version: | 7.3 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 196127 |
Attachments: |
stacktrace
additional logging stacktrace stacktrace stacktrace log with org.openide.filesystems.FileUtil.level=FINE stacktrace stacktrace |
Description
kosmonaffft
2012-12-05 12:44:31 UTC
Created attachment 128890 [details]
stacktrace
Created attachment 128900 [details]
additional logging
additional logging for FileUtil when the problem occurs
There is just a call to remove listener from C:\Users\mkleint\src\nbm-maven\nbm-shared\src\test\resources path, but there is no call to add it. But maybe the log file is truncated. Don't you have by a chance the messages.log.1, etc.? Reporters, please run with -J-Dorg.openide.filesystems.FileUtil.level=FINE and attach your logs here. It will help me analyse the issue more quickly. *** Bug 221564 has been marked as a duplicate of this bug. *** Created attachment 129344 [details]
stacktrace
Closing a project
Created attachment 129356 [details]
stacktrace
Switching between project groups
Created attachment 129387 [details]
stacktrace
Closing maven project
Can one of you guys run with appropriate logging enabled and report bug with more info in your logs?
> Reporters, please run with -J-Dorg.openide.filesystems.FileUtil.level=FINE
> and attach your logs here.
Yes, but i din't see this bug again... (In reply to comment #9) > Can one of you guys run with appropriate logging enabled and report bug with > more info in your logs? > > > Reporters, please run with -J-Dorg.openide.filesystems.FileUtil.level=FINE > > and attach your logs here. Created attachment 129508 [details] log with org.openide.filesystems.FileUtil.level=FINE Steps to reproduce are in comment of submitted exception: http://statistics.netbeans.org/exceptions/exception.do?id=640933 Attaching log with fine logging on FS. Report has 72 dups and counting -> deserves P2. http://statistics.netbeans.org/analytics/exception.do?id=640985 has -J-Dorg.openide.filesystems.FileUtil.level=FINE enabled log Tomáš's log is useful. When I seek for occurrence of /private/tmp/aaa/MavenCRUDSample/src/test/resources (which at the end leads to the final assert), I see duplicated effort to add the listener (does not fail! and I don't know why). And I see duplicated attempt to remove the listener (correctly asserts). The users of the API should not do duplicated registrations and removals. $ grep /private/tmp/aaa/MavenCRUDSample/src/test/resources -C 1 fs-FINE.log | grep maven FINE [org.openide.filesystems.FileUtil]: addFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@7b57ada3@/private/tmp/aaa/MavenCRUDSample/src/main/resources} @ /private/tmp/aaa/MavenCRUDSample/src/main/resources FINE [org.openide.filesystems.FileUtil]: addFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@7b57ada3@/private/tmp/aaa/MavenCRUDSample/src/test/resources} @ /private/tmp/aaa/MavenCRUDSample/src/test/resources FINE [org.openide.filesystems.FileUtil]: removeFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@7b57ada3@/private/tmp/aaa/MavenCRUDSample/src/test/resources} @ /private/tmp/aaa/MavenCRUDSample/src/test/resources FINE [org.openide.filesystems.FileUtil]: removeFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@7b57ada3@/private/tmp/aaa/MavenCRUDSample/src/test/resources} @ /private/tmp/aaa/MavenCRUDSample/src/test/resources java.lang.IllegalArgumentException: DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@7b57ada3@/private/tmp/aaa/MavenCRUDSample/src/test/resources} was not listening to /private/tmp/aaa/MavenCRUDSample/src/test/resources; only to [] (In reply to comment #14) > Tomáš's log is useful. When I seek for occurrence of > /private/tmp/aaa/MavenCRUDSample/src/test/resources (which at the end leads to > the final assert), I see duplicated effort to add the listener (does not fail! > and I don't know why). maybe because the first one is src/main/resources while the other is src/test/resources? just judging from the snippet in the previous comment.. http://hg.netbeans.org/core-main/rev/45c5b531e1d8 I've looked again at how the removal could happen twice. Apparently closed() was called multiple times. Which it should NOT, but jesse mentioned in some old bugs that for some unknown reasons there are sometimes multiple instances of ProjectOpenedHook called. That's the only explanation for closed() being called multiple times. The changeset guards against it. I will file a separate issue for the duplicate content in project lookup. see issue 224012 Clearing resourceURIs in close is good idea. I was also speculating about re-entrant access http://hg.netbeans.org/ergonomics/rev/75eff78bf970, which may be problem as well, but not in this case (as the addRL was called on different folders). Integrated into 'main-golden', will be available in build *201212200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/45c5b531e1d8 User: Milos Kleint <mkleint@netbeans.org> Log: #223309 when closed is called, we need to clear the resourcesURI set as well, not only remove the listeners.. *** Bug 224250 has been marked as a duplicate of this bug. *** reopening, see issue 224250, a report from build later than the integrated one appeared reassigning back to filesystems, all possible issue I've found in the maven codebase are integrated and the problem is still appearing, please see issue 224250 Can one of you guys run with appropriate logging enabled and report bug with
more info in your logs?
> Reporters, please run with -J-Dorg.openide.filesystems.FileUtil.level=FINE
> and attach your logs here.
In my case I cannot reproduce with steps I used to reproduce:( (In reply to comment #23) > Can one of you guys run with appropriate logging enabled and report bug with > more info in your logs? > > > Reporters, please run with -J-Dorg.openide.filesystems.FileUtil.level=FINE > > and attach your logs here. *** Bug 224430 has been marked as a duplicate of this bug. *** I think that this bug happens when I'm moving between git's branches in a cli but of course since the logger config is not kept in between upgrade I have no traces :( activating them ... Reproduced with logger activated: http://statistics.netbeans.org/analytics/messageslog?id=644480 This bug already has 100 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=196127 Created attachment 129868 [details]
stacktrace
Has happened twice when switching between an open project group with many maven projects open, and project group "none"
(In reply to comment #27) > Reproduced with logger activated: > > http://statistics.netbeans.org/analytics/messageslog?id=644480 Alas, it turns out that the log is too huge (because of a lot of other debris) and the uploaded file is trunscated. To address that I have created a special (sub)logger: http://hg.netbeans.org/ergonomics/rev/b77b1524f007 Now I need new report with the above change set and following logging option turned on: -J-Dorg.openide.filesystems.FileUtil.recursive.level=FINE Please generate it asap, otherwise release date of 7.3 may be impacted. *** Bug 224575 has been marked as a duplicate of this bug. *** Integrated into 'main-golden', will be available in build *201301080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b77b1524f007 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #223309: Special logger for recursive listener problem. More detailed exception message here's the desired report: http://statistics.netbeans.org/analytics/exception.do?id=645929 (org.openide.filesystems.FileUtil.recursive.level=FINE) Created attachment 130012 [details]
stacktrace
The last log really seems to indicate that the calls to add/remove are properly ordered. Here is the list of extracted calls. The 2nd call to remove fails and I have no idea why. FINE [org.openide.filesystems.FileUtil.recursive]: addFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@427c5ff3@/tmp/aaa/MavenCRUDSample/crudsample/src/main/resources} @ /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources FINE [org.openide.filesystems.FileUtil.recursive]: addFileChangeListener DeepListener{org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$FCL@3077df72@/tmp/aaa/MavenCRUDSample/crudsample/src/main/resources} @ /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources FINE [org.openide.filesystems.FileUtil.recursive]: removeFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@427c5ff3@/tmp/aaa/MavenCRUDSample/crudsample/src/main/resources} @ /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources FINE [org.openide.filesystems.FileUtil.recursive]: removeFileChangeListener DeepListener{org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$FCL@3077df72@/tmp/aaa/MavenCRUDSample/crudsample/src/main/resources} @ /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources FINE [org.openide.filesystems.FileUtil.recursive]: addFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@427c5ff3@/tmp/aaa/MavenCRUDSample/crudsample/src/main/resources} @ /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources FINE [org.openide.filesystems.FileUtil.recursive]: addFileChangeListener DeepListener{org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$FCL@3077df72@/tmp/aaa/MavenCRUDSample/crudsample/src/main/resources} @ /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Indexing of: /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources took: 69 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 1 ms] FINE [org.openide.filesystems.FileUtil.recursive]: removeFileChangeListener DeepListener{org.netbeans.modules.maven.cos.CopyResourcesOnSave@427c5ff3@/tmp/aaa/MavenCRUDSample/crudsample/src/main/resources} @ /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources WARNING [org.netbeans.modules.project.ui.OpenProjectList] java.lang.IllegalArgumentException: Was not listening to /tmp/aaa/MavenCRUDSample/crudsample/src/main/resources at org.openide.filesystems.FileUtil.removeFileChangeListenerImpl(FileUtil.java:336) at org.openide.filesystems.FileUtil.removeRecursiveListener(FileUtil.java:445) at org.netbeans.modules.maven.cos.CopyResourcesOnSave.closed(CopyResourcesOnSave.java:111) at org.netbeans.modules.maven.ProjectOpenedHookImpl.projectClosed(ProjectOpenedHookImpl.java:289) at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectClosed(ProjectOpenedHook.java:89) at org.netbeans.spi.project.ui.support.UILookupMergerSupport$OpenHookImpl.projectClosed(UILookupMergerSupport.java:260) at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectClosed(ProjectOpenedHook.java:89) [catch] at org.netbeans.modules.project.ui.OpenProjectList.notifyClosed(OpenProjectList.java:1242) at org.netbeans.modules.project.ui.OpenProjectList.access$2500(OpenProjectList.java:137) at org.netbeans.modules.project.ui.OpenProjectList$10.run(OpenProjectList.java:916) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048) I refactored the code into separate class: http://hg.netbeans.org/ergonomics/rev/c7888e349d13 ergonomics#0edb7c90b5c6 A couple of diagnostic things to try - here is the map which is missing the key triggering the exception: private static final Map<FileChangeListener,Map<File,Holder>> holders = new WeakHashMap<FileChangeListener,Map<File,Holder>>(); Try changing it to a regular HashMap, and then to Collections.synchronizedMap(). If either one fixes the problem, then the problem is definitely in filesystems. If not, then it is probably the caller. Integrated into 'main-golden', will be available in build *201301100107* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c7888e349d13 User: Jaroslav Tulach <jtulach@netbeans.org> Log: In preparation of #223309: splitting the listener code out of FileUtil bloated class |