java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Basically, when Hibernate is configured with 'hibernate.use_identifier_rollback' (that is to set primary keys of the deleted entities to null), here is what happens: {code} 2010-12-17 18:52:51,187 TRACE [Hibernate Search: Directory writer-1|] org.hibernate.search.backend.impl.lucene.works.DeleteExtWorkDelegate => Removing class xxx.Vendor#null by id using an IndexWriter. 2010-12-17 18:52:51,187 ERROR [Hibernate Search: Directory writer-1|] org.hibernate.search.backend.impl.lucene.PerDPQueueProcessor => Unexpected error in Lucene Backend: java.lang.NullPointerException at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95) at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:160) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:57) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1046) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1004) at org.apache.lucene.index.IndexWriter.applyDeletes(IndexWriter.java:4566) at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3756) at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3595) at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3585) at org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1717) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1680) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1644) at org.hibernate.search.backend.Workspace.closeIndexWriter(Workspace.java:211) at org.hibernate.search.backend.impl.lucene.PerDPQueueProcessor.run(PerDPQueueProcessor.java:113) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2010-12-17 18:52:51,187 ERROR [Hibernate Search: Directory writer-1|] org.hibernate.search.exception.impl.LogErrorHandler => Exception occurred java.lang.NullPointerException Primary Failure: Entity xxx.Vendor Id null Work Type org.hibernate.search.backend.DeleteLuceneWork java.lang.NullPointerException at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95) at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:160) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:57) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1046) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1004) at org.apache.lucene.index.IndexWriter.applyDeletes(IndexWriter.java:4566) at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3756) at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3595) at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3585) at org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1717) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1680) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1644) at org.hibernate.search.backend.Workspace.closeIndexWriter(Workspace.java:211) at org.hibernate.search.backend.impl.lucene.PerDPQueueProcessor.run(PerDPQueueProcessor.java:113) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2010-12-17 18:52:51,187 WARN [Hibernate Search: Directory writer-1|] org.hibernate.search.backend.Workspace => going to force release of the IndexWriter lock {code} This has not happened in 3.2.1 and Hibernate 3.5.4. I believe this is a serious regression issue.
    via by Kyrill Alyoshin,
  • Basically, when Hibernate is configured with 'hibernate.use_identifier_rollback' (that is to set primary keys of the deleted entities to null), here is what happens: {code} 2010-12-17 18:52:51,187 TRACE [Hibernate Search: Directory writer-1|] org.hibernate.search.backend.impl.lucene.works.DeleteExtWorkDelegate => Removing class xxx.Vendor#null by id using an IndexWriter. 2010-12-17 18:52:51,187 ERROR [Hibernate Search: Directory writer-1|] org.hibernate.search.backend.impl.lucene.PerDPQueueProcessor => Unexpected error in Lucene Backend: java.lang.NullPointerException at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95) at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:160) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:57) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1046) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1004) at org.apache.lucene.index.IndexWriter.applyDeletes(IndexWriter.java:4566) at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3756) at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3595) at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3585) at org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1717) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1680) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1644) at org.hibernate.search.backend.Workspace.closeIndexWriter(Workspace.java:211) at org.hibernate.search.backend.impl.lucene.PerDPQueueProcessor.run(PerDPQueueProcessor.java:113) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2010-12-17 18:52:51,187 ERROR [Hibernate Search: Directory writer-1|] org.hibernate.search.exception.impl.LogErrorHandler => Exception occurred java.lang.NullPointerException Primary Failure: Entity xxx.Vendor Id null Work Type org.hibernate.search.backend.DeleteLuceneWork java.lang.NullPointerException at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95) at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:160) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:57) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1046) at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1004) at org.apache.lucene.index.IndexWriter.applyDeletes(IndexWriter.java:4566) at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3756) at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3595) at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3585) at org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1717) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1680) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1644) at org.hibernate.search.backend.Workspace.closeIndexWriter(Workspace.java:211) at org.hibernate.search.backend.impl.lucene.PerDPQueueProcessor.run(PerDPQueueProcessor.java:113) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 2010-12-17 18:52:51,187 WARN [Hibernate Search: Directory writer-1|] org.hibernate.search.backend.Workspace => going to force release of the IndexWriter lock {code} This has not happened in 3.2.1 and Hibernate 3.5.4. I believe this is a serious regression issue.
    via by Kyrill Alyoshin,
  • Hibernate Search NPE and other id errors
    via by Bai Shen,
    • java.lang.NullPointerException at org.apache.lucene.index.TermBuffer.set(TermBuffer.java:95) at org.apache.lucene.index.SegmentTermEnum.scanTo(SegmentTermEnum.java:158) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:232) at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:179) at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:975) at org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:627) at org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:308) at org.apache.solr.handler.admin.LukeRequestHandler.getDocumentFieldsInfo(LukeRequestHandler.java:248) at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:124) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
    No Bugmate found.