Kevin's Worklog

Documenting the Daily Stream

NullPointerException on FSBlobIdIterator setChildPaths

Figuring out what went wrong with my fcrepo3 move took a bit of work (i.e., floundering), so I’ll document where I went wrong. I moved the repository file system, including its data directory, between machines and thought I’d successfully updated all the necessary config files. But, when I went to rebuild Fedora’s resource index, I got the following error:

Rebuilding...
Initializing triplestore interface...
Clearing directory /opt/fedora/data/resourceIndex...
Finished.
Rebuild failed:
    java.lang.NullPointerException
        at org.akubraproject.fs.FSBlobIdIterator$DirectoryNode.setChildPaths(FSBlobIdIterator.java:97)
        at org.akubraproject.fs.FSBlobIdIterator$DirectoryNode.<init>(FSBlobIdIterator.java:85)
        at org.akubraproject.fs.FSBlobIdIterator.<init>(FSBlobIdIterator.java:45)
        at org.akubraproject.fs.FSBlobStoreConnection.listBlobIds(FSBlobStoreConnection.java:73)
        at org.akubraproject.map.IdMappingBlobStoreConnection.listBlobIds(IdMappingBlobStoreConnection.java:89)
        at org.fcrepo.server.storage.lowlevel.akubra.AkubraLowlevelStorage.listBlobIds(AkubraLowlevelStorage.java:506)
        at org.fcrepo.server.storage.lowlevel.akubra.AkubraLowlevelStorage.list(AkubraLowlevelStorage.java:282)
        at org.fcrepo.server.storage.lowlevel.akubra.AkubraLowlevelStorage.listObjects(AkubraLowlevelStorage.java:173)
        at org.fcrepo.server.storage.lowlevel.akubra.AkubraLowlevelStorageModule.listObjects(AkubraLowlevelStorageModule.java:125)
        at org.fcrepo.server.utilities.rebuild.Rebuild.run(Rebuild.java:133)
        at org.fcrepo.server.utilities.rebuild.Rebuild.main(Rebuild.java:462)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.fcrepo.server.utilities.rebuild.cli.CLILoader.main(CLILoader.java:77)

It turns out the $FEDORA_HOME/server/config/spring/akubra-llstore.xml update had been somehow bungled. In that file, I’ve learned, are two important configurations:

<bean name="fsObjectStore" class="org.akubraproject.fs.FSBlobStore" singleton="true">
    <constructor-arg value="urn:example.org:fsObjectStore" />
    <constructor-arg value="/opt/fedora/data/objectStore"/>
</bean>

and

<bean name="fsDatastreamStore" class="org.akubraproject.fs.FSBlobStore" singleton="true">
    <constructor-arg value="urn:example.org:fsDatastreamStore" />
    <constructor-arg value="/opt/fedora/data/datastreamStore"/>
</bean>

In my case, the objectStore configuration had an extra /fedora/ in its path. Once I fixed that, the resource index could then be built without the NullPointerException.