SOLR issues with updating indexes periodically (solrdataimportproperties Error loading Dataimportscheduler properties Java.lang.NullPointerException)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.