My Jersey Application container is shutdown with below exception message.
java.lang.IllegalStateException: ServiceLocatorImpl(__HK2_Generated_0,0,1879131528) has been shut down
at org.jvnet.hk2.internal.ServiceLocatorImpl.checkState(ServiceLocatorImpl.java:2288)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandleImpl(ServiceLocatorImpl.java:629)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:622)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:640)
at org.jvnet.hk2.internal.FactoryCreator.getFactoryHandle(FactoryCreator.java:103)
... 59 common frames omitted
Wrapped by: org.glassfish.hk2.api.MultiException: A MultiException has 1 exceptions. They are:
1. java.lang.IllegalStateException: ServiceLocatorImpl(__HK2_Generated_0,0,1879131528) has been shut down
Whenever the above error is coming the application is not able to process the request. It repeatedly showing the same message and also my spring application container also down.Below is the error message i am getting repatedly.
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'daoQuery': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
My Glassfish Jersey Version is 2.22.2.
The above thing happens only in heavy load.
We analyzed the issue and found that this issue happen in multiple scenarios.
- Load Balancer Time Out High
- Jersey Hk2 conflict
We corrected those two points, but still we are getting the same error in heavy load.
Is there any way to prevent or fix issue?