Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 419071

Summary: [server] NullPointerException in Indexer.indexWorkspace() after migration
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ServerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne
Version: 4.0   
Target Milestone: 5.0 RC1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2013-10-09 14:23:50 EDT
When migrating the storage from Orion 3.0 CompatibilityMetaStore to Orion 4.0 SimpleMetaStore, the end result is the local project location changing on disk from /serverworkspace/A/A/B to /serverworkspace/an/anthony/OrionContent/Project.

As a result I have been deleting the index folder before migration so that new indexes are built.

If you forget and leave the old indexes there, you get a NPE:

java.lang.NullPointerException
	at org.eclipse.orion.internal.server.search.Indexer.indexWorkspace(Indexer.java:144)
	at org.eclipse.orion.internal.server.search.Indexer.indexUser(Indexer.java:130)
	at org.eclipse.orion.internal.server.search.Indexer.run(Indexer.java:288)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Comment 1 John Arthorne CLA 2014-01-20 21:28:03 EST
We can force index regeneration programmatically by incrementing SearchActivator#CURRENT_INDEX_GENERATION. After that change all servers will get indexes regenerated on startup.
Comment 2 John Arthorne CLA 2014-01-20 21:28:46 EST
Oops just realized this bug is a few months old. I believe I fixed the symptom (NPE) already. We should make sure index generation is incremented at least once for 5.0 release though.
Comment 3 Anthony Hunter CLA 2014-02-07 12:05:01 EST
(In reply to John Arthorne from comment #2)
> Oops just realized this bug is a few months old. I believe I fixed the
> symptom (NPE) already. We should make sure index generation is incremented
> at least once for 5.0 release though.

Yes, I have verified that this NPE no longer occurs.