You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the LuceneConenctor constructor, there is a try/catch, wherein the catch attempts to use the private log4j Logger (named LOG) to log any IOExceptions thrown. The problem is that in Java static member variables are initialized in the order they are declared in the java file and the LuceneConnector's singleton instance initialization precedes the Logger's initialization. This is a simple fix. Simply swap the order of the LuceneConnector and Logger static member variable declarations/initializations so that the Logger is first (lines 58 and 59). Also, it couldn't hurt to catch (and rethrow if you like) all exceptions in the LuceneConnector constructor, as I was chasing down a nasty NullPointerException (related to a configuration problem of my own fault), and for posterity, that might save them some effort debugging.
The text was updated successfully, but these errors were encountered:
In the LuceneConenctor constructor, there is a try/catch, wherein the catch attempts to use the private log4j Logger (named LOG) to log any IOExceptions thrown. The problem is that in Java static member variables are initialized in the order they are declared in the java file and the LuceneConnector's singleton instance initialization precedes the Logger's initialization. This is a simple fix. Simply swap the order of the LuceneConnector and Logger static member variable declarations/initializations so that the Logger is first (lines 58 and 59). Also, it couldn't hurt to catch (and rethrow if you like) all exceptions in the LuceneConnector constructor, as I was chasing down a nasty NullPointerException (related to a configuration problem of my own fault), and for posterity, that might save them some effort debugging.
The text was updated successfully, but these errors were encountered: