Hi Jose,

This is a bit confusing, cause the error you show says the 
NullPointerException is on line 616 of DSIndexer.java.  In version 4.x 
of DSpace, that's this line (and NOT the "liveDocs" line you sent 
previously):

https://github.com/DSpace/DSpace/blob/dspace-4_x/dspace-api/src/main/java/org/dspace/search/DSIndexer.java#L616

Have you modified/customized the DSIndexer.java file in some way? Are 
you certain you've fully upgraded all your code to 4.x?

Based on the docs for the MultiFields.getLiveDocs() method though, it 
does also sound like we are missing a check for null:
https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/index/MultiFields.html#getLiveDocs(org.apache.lucene.index.IndexReader)

Since getLiveDocs can return null, it's likely the fix here may be to 
change the 'if' to be:

if (liveDocs!=null && !liveDocs.get(i))

So, this sounds like it also may be a possible bug.

- Tim


On 6/27/2014 10:40 AM, Jose Blanco wrote:
> I just ran index-lucene-init and it completed successfully, but when I
> try to run
>
> index-lucene-update, it blows up at where I have (****):
>
>       */
>      public static void cleanIndex(Context context) throws IOException,
> SQLException {
>
>      IndexReader reader = DSQuery.getIndexReader();
>
>      Bits liveDocs = MultiFields.getLiveDocs(reader);
>
>      for(int i = 0 ; i < reader.numDocs(); i++)
>      {
> (****)       if (!liveDocs.get(i))
>
>
> The error I'm getting is
>
> Exception: null
> java.lang.NullPointerException
>          at org.dspace.search.DSIndexer.cleanIndex(DSIndexer.java:616)
>
> I know reader is not null, but liveDocs must be, but why?
>
> -Jose
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette: 
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to