bhavikpatel9977 commented on issue #3267: [ZEPPELIN-3609] Refactoring `ZeppelinServer` to adopt DI URL: https://github.com/apache/zeppelin/pull/3267#issuecomment-544474154 @jongyoul: Is there any specific reason for moving logic (initialization of classes) from the default constructor to the main method? The reason behind asking this is, that I am working on [ZEPPELIN-4356](https://issues.apache.org/jira/browse/ZEPPELIN-4356), Zeppelin Server should stop when it can't create/access a notebook or if **Shiro.ini** file is not configured properly (WIP [pr-3488](https://github.com/apache/zeppelin/pull/3488)). So to achieve this I have used Immediate scope while binding the classes in ServiceLocator and successfully able to stop the Zeppelin Server, if it can't access/create a notebook & if Shiro configuration is wrong. Also, the exception is thrown when _realms are null_. Because of these changes few test-cases are failing and it throws the exception "realm is null" but it should not be null. While debugging, I found that the **ShiroValidationService** class with **Immediate** scope is executed before the **Shiro environment gets initialized** due to multithreading, and that results in an error of "_realm was found null_" but normally it should not be null. Also, I have checked your commits initially you have also used **Immediate** scope for **ShiroAuthenticationService**, later on, you have reverted that changes and used **Singleton** scope; is there any specific reason for that or any issue that you have observed?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
