问题描述
我们有一个运行在Tomcat 7上的Web应用程序,它加载了一个JNI库模块,该模块用C ++编码,由第三方开发。基本上,这个库为我们的网络应用程序提供生物识别技术。我们不能使用所有的java解决方案,没有其他选择,使用那个JNI库模块。
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.
问题是有时,JNI库模块崩溃,因为它做分割错误并破坏内存。
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.
当加载的JNI库模块崩溃时,有没有办法防止tomcat完全崩溃?理想情况下,当JNI库模块崩溃时,我们希望收到通知,并有机会重新加载Web应用程序/模块。这是可能吗?
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?
感谢您的帮助。
推荐答案
可以启动另一个JVM加载JNI库。当JVM死机时,您可以重新启动它从您的Tomcat。
You can start another JVM which loads the JNI library. When the JVM dies, you can restart start it from your Tomcat.
这篇关于有一种方法来防止Tomcat在加载的JNI库破坏内存时崩溃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!