Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Resolve Generic Engine spellcheck reindexing causes java.lang.NullPointerException

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 388
    Comment on it

    Hello Guys

    Many times we are getting NullPointerException in our liferay server log during upload, upadte and delete files.

    Error look like as below in our server log :

    20:22:50,828 INFO  [liferay/search_writer/SYSTEM_ENGINE-3][BaseSpellCheckIndexWriter:255] Start indexing dictionary for com/liferay/portal/search/lucene/dependencies/spellchecker/en_US.txt
    20:22:50,829 WARN  [liferay/search_writer/GENERIC_ENGINE-1][ProxyMessageListener:81] java.lang.NullPointerException
    java.lang.NullPointerException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.liferay.portal.kernel.messaging.proxy.ProxyRequest.execute(ProxyRequest.java:85)
            at com.liferay.portal.kernel.messaging.proxy.ProxyMessageListener.receive(ProxyMessageListener.java:51)
            at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
            at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
            at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
            at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
            at java.lang.Thread.run(Thread.java:662)
    

    I have resovled this issue, Please follow below steps :

    Step 1: Download apache-solr-4.0.0.zip from 'http://archive.apache.org/dist/lucene/solr/4.0.0/' website.

    Step 2: Unzip apache-solr-4.0.0.zip to an folder.

    Step 3: Navigate to apache-solr-4.0.0/example in terminal and type 'java -jar start.jar'

    Step 4: After the server has started up, shut it down.

    Step 5: Start Liferay server and deploy the Solr4 plugin.

    Step 6: After Liferay server started, shut it down.

    Step 7: Navigate in folder to /tomcat-7.0.42/webapps/solr4-web/WEB-INF/classes/META-INF

    Step 8: Open solr-spring.xml file.

    Step 9: Change 'http://localhost:8080/solr' to 'http://localhost:8983/solr'

    Step 10: The changed line should look like this:

    <constructor-arg type="java.lang.String" value="http://localhost:8983/solr/">
    



    Step 11: Save and close solr-spring.xml

    Step 12: Navigate in folder to /tomcat-7.0.42/webapps/solr4-web/WEB-INF/conf

    Step 13: Open the schema.xml file and do a find for 'version'

    Step 14: If it does not have it, then add

    <field indexed="true" multivalued="false" name="version" stored="true" type="string"/> 
    after a <dynamicfield indexed="" ..=""/>
    



    Step 15: Save and close the file

    Step 16: Copy the schema.xml file

    Step 17: Paste the file in apache-solr-4.0.0/example/solr/collection1/conf to replace the existing schema.xml file.

    Step 18: Start the Solr4 server in apache-solr-4.0.0/example (java -jar start.jar)

    Step 19: Start liferay server

    Step 20: There will be a lot of output on the Solr4 console (means it's working)

    Step 21: Navigate to Control Panel > Server Administration and reindex the spellcheck indexes

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: