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: | RecorgnizeInstanceObjects lookup can be empty was: IllegalStateException from JWSProjectOpenHook | ||
---|---|---|---|
Product: | platform | Reporter: | Tomas Zezula <tzezula> |
Component: | Options&Settings | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aldobrucale, jkovalsky, jskrivanek, kanakmar, mkleint, neigor, SimonLissack, sreimers, theofanis |
Priority: | P2 | Keywords: | ERGONOMICS |
Version: | 7.2 | ||
Hardware: | PC | ||
OS: | Mac OS X | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 230469 | ||
Attachments: |
LazyLookupProviders.java diff
Reusing previous FolderLookup in RecognizeInstanceObjects seems to fix the problem stacktrace |
Description
Tomas Zezula
2013-07-08 16:56:21 UTC
The exception is caused by en existence of multiple instances of the JWSProjectOpenHook. The projectOpened is called on different instance than the projectClosed which causes the ISE. The problem is that the lookup result of a lookup created by Lookups.forPath() for a short while has no items (neither old ones nor new ones) in this time the DelegatingLookupImpl deletes the old map and in next run it recreates the object instances by calling createAdditionalLookup on LookupProviders. The issue is a race, so it's not 100% reproduceable but it happens quite common with following steps: 1) Open IDE with ergonomics and empty user dir 2) Create a new J2SE Project (activates J2SE cluster) 3) Create a new Web Proejct (activates Web cluster) 4) Close the J2SE Project -> ISE is thrown Added logging, jet-main c829fde0bf39 With following loggers enabled: -J-Dorg.netbeans.modules.projectapi.LazyLookupProviders.level=FINE -J-Dorg.netbeans.spi.project.support.DelegatingLookupImpl.lel=FINE you will see something like: FINE [org.netbeans.spi.project.support.DelegatingLookupImpl]: New providers count: 43 for: 1,019,746,124 FINE [org.netbeans.spi.project.support.DelegatingLookupImpl]: New providers count: 0 for: 1,019,746,124 FINE [org.netbeans.spi.project.support.DelegatingLookupImpl]: New providers count: 43 for: 1,019,746,124 Followed by several Additional lookup created including additional lookup for JWSProjectOpenHook FINE [org.netbeans.modules.projectapi.LazyLookupProviders]: Additional lookup created: 1,734,677,261 service class: org.netbeans.modules.javawebstart.JWSProjectOpenHook for base lookup: 1,048,594,742 when the web cluster is being enabled. The issue can be "fixed" by an attached patch which caches the created additional Lookups. However this is rather workaround and it would be better to fix the Lookups.forPath Lookup as the patch is sensitive to possible Lookup.equals() and similar problem may exist on different places. Created attachment 136835 [details]
LazyLookupProviders.java diff
*** Bug 232516 has been marked as a duplicate of this bug. *** Integrated into 'main-silver', will be available in build *201307112300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/c829fde0bf39 User: Tomas Zezula <tzezula@netbeans.org> Log: #232400: IllegalStateException from JWSProjectOpenHook - logging *** Bug 232949 has been marked as a duplicate of this bug. *** I have reproduced the problem. Created attachment 137671 [details]
Reusing previous FolderLookup in RecognizeInstanceObjects seems to fix the problem
Created attachment 137697 [details]
stacktrace
This exception appears during closing javaapplication (Git).
- select project root in Project view
- invoke popup menu via right-click and select "Close" => application is closed, but this exception appears
*** Bug 233320 has been marked as a duplicate of this bug. *** I write a test and integrate the fix. ergonomics#005f341dfc65 *** Bug 230469 has been marked as a duplicate of this bug. *** Integrated into 'main-silver', will be available in build *201308072300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/005f341dfc65 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #232400: Reuse previous instance of FolderLookup rather than creating new on every change *** Bug 234463 has been marked as a duplicate of this bug. *** See issue #234463 What makes you believe bug 234463 is a duplicate? Does it involve enabling of modules? If not, it has some different cause. The call to the POH is asymmetric -> several instances were created by the Lookup. It can be caused by Project's merged lookup, however previously the reason was this issue. Unfortunately I cannot find the messages.log in the exception report of the issue #234463 to prove it. Well, without message log or without a way to reproduce the failure, there is nothing I can do. Marking fixed again. *** Bug 235590 has been marked as a duplicate of this bug. *** |