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 186939 - PluginIndexManager uses own prebuilt Lucene index, sometimes throws FNFE
Summary: PluginIndexManager uses own prebuilt Lucene index, sometimes throws FNFE
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: PLAN
Depends on:
Blocks: 154108
  Show dependency tree
 
Reported: 2010-05-29 11:56 UTC by Exceptions Reporter
Modified: 2011-07-26 14:00 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 147311


Attachments
stacktrace (1.04 KB, text/plain)
2010-05-29 11:56 UTC, Exceptions Reporter
Details
Work in progress (36.91 KB, patch)
2011-07-01 00:40 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2010-05-29 11:56:05 UTC
Build: NetBeans IDE 6.8 (Build 200912041610)
VM: Java HotSpot(TM) Client VM, 16.0-b13, Java(TM) SE Runtime Environment, 1.6.0_18-b07
OS: Windows XP

User Comments:
t_yano: simplly select 'action' on project property dialog.

t_yano: select 'Action' from category pane of project property dialog.

t_yano: open project property dialog and select 'action' on the dialog.

t_yano: select 'Action' on Project Property Dialog of Mave Project.

t_yano: Open project property window.

t_yano: click save button on Properties dialog of Maven Project after changing some settings.




Stacktrace: 
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\Documents and Settings\dutour_d\.netbeans\6.8\var\cache\maven-plugins-index\7: files:
   at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:604)
   at org.apache.lucene.index.DirectoryIndexReader.open(DirectoryIndexReader.java:115)
   at org.apache.lucene.index.IndexReader.open(IndexReader.java:316)
   at org.apache.lucene.index.IndexReader.open(IndexReader.java:227)
   at org.netbeans.modules.maven.indexer.api.PluginIndexManager.getIndexSearcher(PluginIndexManager.java:126)
   at org.netbeans.modules.maven.indexer.api.PluginIndexManager.getPluginGoalNames(PluginIndexManager.java:133)
Comment 1 Exceptions Reporter 2010-05-29 11:56:09 UTC
Created attachment 99642 [details]
stacktrace
Comment 2 Jesse Glick 2010-10-06 20:16:41 UTC
All this code was introduced to complete plugin names, apparently. Maybe can be taken from the index instead?
Comment 3 Jesse Glick 2010-10-07 16:18:54 UTC
Since the index is prebuilt, as a hotfix might be able to just discard the cached value if any problem arises.

More generally, the design is poor here. There used to be a bunch of XML files shipped with the IDE listing known plugins and their goals, produced by some script (I have no idea what); this was converted to a binary Lucene index, occasionally updated. The index is now pretty well out of date; for example, it makes no mention of maven-nbm-plugin 3.2, much less the recently released 3.3.

Better would be to go through RepositoryQueries, i.e. the regular repository index, which will be nearly current. In particular, MavenPluginArtifactInfoIndexCreator already records FLD_PLUGIN_PREFIX and FLD_PLUGIN_GOALS, which will probably suffice to honor getPluginGoalNames, getPluginGoals, and getPluginsForGoalPrefix. getPluginParameters can likely be accomplished by directly parsing META-INF/maven/plugin.xml from the local copy of the artifact, or perhaps by using MavenPluginManager. getLifecyclePlugins I am less sure about; surely there is some interface in Maven that would work for this purpose, though in the absence of meaningful Javadoc it is hard to tell; LifeCyclePluginAnalyzer looks promising.
Comment 4 Jesse Glick 2011-07-01 00:40:42 UTC
Created attachment 109176 [details]
Work in progress
Comment 5 Jesse Glick 2011-07-05 19:49:18 UTC
core-main #3eeb7a66a819
Comment 6 Quality Engineering 2011-07-06 14:05:30 UTC
Integrated into 'main-golden', will be available in build *201107060600* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3eeb7a66a819
User: Jesse Glick <jglick@netbeans.org>
Log: #186939: rewrite PluginIndexManager to use the regular Nexus index.
Comment 7 Jesse Glick 2011-07-19 17:18:35 UTC
*** Bug 200239 has been marked as a duplicate of this bug. ***