Cannot Login Error Message javax.servlet.ServletException: java.lang.ExceptionInInitializerError

Symptons

When the users are trying to login into the application is always raising the error javax.servlet.ServletException: java.lang.ExceptionInInitializerError.

Cause

This error happens when something has gone wrong while starting the openkm repository, possible causes are:

  • Unexpected or wrong server shutdown what has corrupted Lucene Search Engine.
  • The OpenKM application has stopped incorrectly. Usually the process has been killed while the Lucene Search Engine was still perfoming some operations in background.

Diagnosis

Check the log of the application looking for Lucene Search Engine errors.

Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/opt/tomcat/repository/index/com.openkm.dao.bean.NodeBase/write.lock
    at org.apache.lucene.store.Lock.obtain(Lock.java:84)
    at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1097)
    at org.hibernate.search.store.DirectoryProviderHelper.initializeIndexIfNeeded(DirectoryProviderHelper.java:159)
    ... 33 more

Solution

In case in log file is shown a "write.lock" error, simply - with OpenKM stopped - remove the two write.lock files into $TOMCAT_HOME/repository/index/com.openkm.dao.bean.NodeBase and $TOMCAT_HOME/repository/index/com.openkm.dao.bean.NodeDocument and start the application again.

If the step before not solves the error, then you must rebuild entire search index. For it - with OpenKM stopped - delete the folder $TOMCAT_HOME/repository/index. Start OpenKM and then from Administration execute the action "Rebuild Indexes".

Take in consideration, the Rebuild Indexes action can take a lot of time - hours - depending your repository size. During the process the repository in under read only status and is not recommended users access on it until the action be finished.

Properties

Properties

Date

2016-07-31

Applies to

  • Frontend
  • Core

Keywords

  • AllVersions
  •