Problem description
reported the following error, it is obvious that the cause of the problem: null pointer exception;
Error (LOCALHOST-STARTSTOP-1) [] o.a.s.h.d.s.solrdataimportproperties Error loading Dataimportscheduler properties
Java.lang.NullPointerException
At Sun.nio.fs.UnixPath.normalizeAndCheck (unixpath.java:77)
At Sun.nio.fs.unixpath.<init> (unixpath.java:71)
At Sun.nio.fs.UnixFileSystem.getPath (unixfilesystem.java:281)
At Java.nio.file.Paths.get (paths.java:84)
At Org.apache.solr.core.solrresourceloader.<init> (solrresourceloader.java:151)
At Org.apache.solr.handler.dataimport.scheduler.SolrDataImportProperties.loadProperties ( SOLRDATAIMPORTPROPERTIES.JAVA:36)
At Org.apache.solr.handler.dataimport.scheduler.BaseTimerTask.reloadParams (basetimertask.java:57)
At Org.apache.solr.handler.dataimport.scheduler.basetimertask.<init> (basetimertask.java:39)
At Org.apache.solr.handler.dataimport.scheduler.deltaimporthttppostscheduler.<init> ( DELTAIMPORTHTTPPOSTSCHEDULER.JAVA:20)
At Org.apache.solr.handler.dataimport.scheduler.ApplicationListener.contextInitialized (Applicationlistener.java : 47)
At Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:4716)
At Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5178)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:152)
At Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:724)
At Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:700)
At Org.apache.catalina.core.StandardHost.addChild (standardhost.java:734)
At Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1107)
At Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1841)
At Java.util.concurrent.executors$runnableadapter.call (executors.java:511)
At Java.util.concurrent.FutureTask.run (futuretask.java:266)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1142)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:617)
At Java.lang.Thread.run (thread.java:745)
Detailed reason: Regular update using the jar package Apache-solr-dataimportscheduler-1.1.jar is online looking, as if the version is not up, decompile, the problem in the Solrdataimportproperties class of 36 lines, the following red position:
public void loadProperties (boolean Force) { try {solrresourceloader loader = New S Olrresourceloader (null Logger.info ( Instance dir = "+ Loader.getinstancedir ()); String configdir = Loader.getconfigdir (); Configdir = Solrresourceloader.normalizedir (configdir);
My SOLR version is 5.5.3, find Org.apache.solr.core.SolrResourceLoader, view its construction method, there are four, we are using the public Solrresourceloader ( Path instancedir), due to a null error in the incoming instancedir (the specific internal code is not debugged):
PublicSolrresourceloader () { This(Locatesolrhome (),NULL,NULL); } PublicSolrresourceloader (Path instancedir, ClassLoader parent) { This(Instancedir, parent,NULL); } PublicSolrresourceloader (Path instancedir) { This(Instancedir,NULL,NULL); } PublicSolrresourceloader (Path instancedir, ClassLoader parent, Properties coreproperties) {if(Instancedir = =NULL) {
...How to Solve
Modify the apache-solr-dataimportscheduler-1.1 code, repackage, tested, scheduled incremental update and full-volume update function as expected.
Accessories (modified jar package)
Download Link:
Http://files.cnblogs.com/files/chenpi/solr-dataimportscheduler-1.1-source.zip
SOLR issues with updating indexes periodically (solrdataimportproperties Error loading Dataimportscheduler properties Java.lang.NullPointerException)