Hazelcast embedded in tomcat

不羁岁月 提交于 2019-12-13 10:36:00

问题


I need to start Hazelcast within Tomcat without separate war-file. So put hazelcast.jar into lib folder, hazelczast.xml somewhere... What next? Or it is not possible?


回答1:


First step was ok, just place Hazelcast lib and configuration inside the libs folder of Tomcat. Next thing, if you don't want a separate WAR file, is to build a small Valve class that starts up / shuts down the Hazelcast node. The question is: What do you want to achieve with this, since for a practical use you will likely have to access the Hazelcast instance itself (which should be possible to place it as an attribute inside the HttpRequest).

Chris




回答2:


It should be possible. But you need to have some piece of code calling Hazelcast.newHazelcastInstance, or else nothing will happen.




回答3:


I have found it easiest to just use Spring Boot and start hazelcast in the spring context.



来源:https://stackoverflow.com/questions/22784347/hazelcast-embedded-in-tomcat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!