Is there a way to prevent Tomcat from crashing when a loaded JNI library corrupts memory?

不羁岁月 提交于 2020-01-04 02:48:08

问题


We have a web application running on Tomcat 7 and it loads a JNI library module that was coded in C++ and which was developped by a third party. Basically, this library provides biometric technology to our web app. We cannot use an all java solution for this and have no other choice than to use that JNI library module.

The problem is that sometimes, the JNI library module crashes because it does a segmentation fault and corrupts memory. When that happens, it makes Tomcat crash completely without warning.

Is there a way to prevent tomcat from completely crashing when a loaded JNI library module crashes? Ideally, when the JNI library module crashes, we would like to be notified and have a chance to reload the web app/module. Is that possible?

Thanks for the help.


回答1:


You can start another JVM which loads the JNI library. When the JVM dies, you can restart start it from your Tomcat.



来源:https://stackoverflow.com/questions/6228372/is-there-a-way-to-prevent-tomcat-from-crashing-when-a-loaded-jni-library-corrupt

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