Rule Definition
JNI is one of the most serious cause of application server crash that can be due for example to buffer overflow. Even if your code works on a plateform, it doesn't mean that it will work on other plateform because the internals of JVMs differ.
In case of crash, your JVM suplier's support will probably ask you to remove these calls before investigating your issue.
Also, for portability purposes, native Methods should not be used. Native Methods could be compared to Interfaces to encapsulate calls to C Methods and Functions. Doing so relies on having the appropriate environment setup at the operating system level.
Remediation
Don't use JNI for security reason
Violation Code Sample
class Echo { public native void runEcho(); static { System.loadLibrary("echo"); } public static void main(String[] args) { new Echo().runEcho(); //VIOLATION } }
Reference
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Frzaha%2Fothlang.htm
http://en.wikipedia.org/wiki/Java_Native_Interface#Pitfalls
Related Technologies
JEE
Technical Criterion
Programming Practices - Unexpected Behavior
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.