com.hazelcast.session.HazelcastSessionManager startInternal
SEVERE: Hazelcast Client could not be created.
java.lang.NullPointerException
at com.hazelcast.session.HazelcastSessionManager.startInternal(HazelcastSessionManager.java:92)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5272)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Nov 14, 2018 3:12:39 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: The session manager failed to start
org.apache.catalina.LifecycleException: Failed to start component [com.hazelcast.session.HazelcastSessionManager[/pbrc]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5272)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException
at com.hazelcast.session.HazelcastSessionManager.startInternal(HazelcastSessionManager.java:96)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
After running through debugger in IntelliJ:
When in client mode HazelcastSessionManager attempts to retrieve client config from ClientServerLifecycleListener within the startInternal method.
ClientConfig is only created in ClientServerLifecycleListener on the Tomcat "start" LifeCycle event, which occurs after the state change so is never created in time for the session manager to use.
NPE when starting Hazelcast Client in embedded Tomcat 8
Embedded Tomcat Version: 8.0.30 Hazelcast version: 3.1.1 HazelcastSessionManager version: hazelcast-tomcat8-sessionmanager-1.1.3
Running embedded tomcat and setting hazelcast via:
Results in following NPE:
After running through debugger in IntelliJ:
When in client mode HazelcastSessionManager attempts to retrieve client config from ClientServerLifecycleListener within the startInternal method.
ClientConfig is only created in ClientServerLifecycleListener on the Tomcat "start" LifeCycle event, which occurs after the state change so is never created in time for the session manager to use.