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 195721 - UnsupportedOperationException: This IndexReader cannot make any changes to the index (it was opened with readOnly = true)
Summary: UnsupportedOperationException: This IndexReader cannot make any changes to th...
Status: RESOLVED FIXED
Alias: None
Product: python
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: All All
: P1 normal with 8 votes (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
: 196626 197354 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-20 11:13 UTC by michbarsinai
Modified: 2013-05-07 08:48 UTC (History)
64 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 176371


Attachments
stacktrace (2.26 KB, text/plain)
2011-02-20 11:13 UTC, michbarsinai
Details
stacktrace (2.26 KB, text/plain)
2011-02-25 12:45 UTC, Exceptions Reporter
Details
stacktrace (2.25 KB, text/plain)
2011-11-02 11:18 UTC, Michal Mocnak
Details
stacktrace (2.92 KB, text/plain)
2012-05-24 20:53 UTC, Lukas Hasik
Details
Patch to ignore this Exception. (533 bytes, patch)
2012-07-26 20:54 UTC, psychart
Details | Diff
stacktrace (2.18 KB, text/plain)
2012-11-13 22:29 UTC, _ pandajava
Details
stacktrace (2.19 KB, text/plain)
2013-02-27 07:50 UTC, sreimers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michbarsinai 2011-02-20 11:13:11 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-6578-on-110201)
VM: Java HotSpot(TM) Client VM, 19.0-b09, Java(TM) SE Runtime Environment, 1.6.0_23-b05
OS: Linux

User Comments:
vernons: Trying to open/initialize a default Python application after installing the Python plug-in and restarting.

michbarsinai: Selectign text using keyboard in a python module




Stacktrace: 
java.lang.UnsupportedOperationException: This IndexReader cannot make any changes to the index (it was opened with readOnly = true)
   at org.apache.lucene.index.ReadOnlySegmentReader.noWrite(ReadOnlySegmentReader.java:23)
   at org.apache.lucene.index.ReadOnlyDirectoryReader.acquireWriteLock(ReadOnlyDirectoryReader.java:41)
   at org.apache.lucene.index.IndexReader.deleteDocument(IndexReader.java:871)
   at org.apache.lucene.index.IndexReader.deleteDocuments(IndexReader.java:907)
   at org.netbeans.modules.gsfret.source.usages.LuceneIndex.batchStore(LuceneIndex.java:515)
   at org.netbeans.modules.gsfret.source.usages.SourceAnalyser.batchStore(SourceAnalyser.java:171)
Comment 1 michbarsinai 2011-02-20 11:13:15 UTC
Created attachment 106211 [details]
stacktrace
Comment 2 David Strupl 2011-02-20 21:49:51 UTC
This needs to be evaluated by someone who works on the python support.
Comment 3 Exceptions Reporter 2011-02-25 12:45:42 UTC
Created attachment 106445 [details]
stacktrace
Comment 4 Exceptions Reporter 2011-07-29 23:05:31 UTC
This bug already has 150 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=176371
Comment 5 Exceptions Reporter 2011-09-06 06:26:15 UTC
This bug already has 200 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=176371
Comment 6 Michal Mocnak 2011-11-02 11:18:18 UTC
Created attachment 112735 [details]
stacktrace

Just create a new python project for Python 2.6.5
Comment 7 Marian Mirilovic 2011-11-07 08:54:15 UTC
*** Bug 197354 has been marked as a duplicate of this bug. ***
Comment 8 Marian Mirilovic 2012-04-12 13:04:36 UTC
*** Bug 196626 has been marked as a duplicate of this bug. ***
Comment 9 Exceptions Reporter 2012-05-09 14:41:55 UTC
This bug already has 900 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=176371
Comment 10 Lukas Hasik 2012-05-24 20:53:22 UTC
Created attachment 119844 [details]
stacktrace

ctrl+space in xyz.py file
Comment 11 psychart 2012-07-26 20:54:32 UTC
Created attachment 122433 [details]
Patch to ignore this Exception.

According to https://issues.apache.org/jira/browse/LUCENE-1558, Lucene set readOnly to true by default in version 3.0.

Ignoring this exception vanish the errors on IDE and autocomplete works.

Dunno if its the best way to deal with this, but works for now and if breaks anything else i report here.
Comment 12 charlweed 2012-08-22 02:38:37 UTC
This is worse then it seems.
It turns out that if you leave a python project open at exit, when NetBeans restarts it will hang upon re-opening it. The to fix it users must prevent the attempt to open, such as creating a new profile!
Big, bad, bug.
Comment 13 charlweed 2012-08-22 23:17:16 UTC
(In reply to comment #11)
> Created attachment 122433 [details]
> Patch to ignore this Exception.
> 
> According to https://issues.apache.org/jira/browse/LUCENE-1558, Lucene set
> readOnly to true by default in version 3.0.
> 
> Ignoring this exception vanish the errors on IDE and autocomplete works.
> 
> Dunno if its the best way to deal with this, but works for now and if breaks
> anything else i report here.

Your patch works OK as a workaround for me. I discovered that if I did NOT apply your patch, NetBeans will effectively hang at launch if any python projects are open.
Comment 14 _ pandajava 2012-11-13 22:29:32 UTC
Created attachment 127741 [details]
stacktrace

Netbeans C/C++ startup
Comment 15 sreimers 2013-02-27 07:50:14 UTC
Created attachment 131936 [details]
stacktrace
Comment 16 adam_felix_fps 2013-04-30 09:10:12 UTC
How do you apply the patch?  I installed from the repository recommended by Geertjan.  Any help would be appreciated...
Comment 17 Petr Jiricka 2013-05-07 08:48:39 UTC
I applied the patch attached in comment #11 blindly, without testing it:
http://hg.netbeans.org/main/contrib/rev/52101cf77723

It should be propagated to the update center in the next 12 hours - would be great if someone could verify that the problem is fixed. Thanks.