后台是tomcat,java现在碰到一个问题就是调用中控指纹DLL,一直验证不通过,谁能帮忙做一个简单的例子呢?
我的操作系统是win7,
package com.test;import org.xvolks.jnative.JNative;
import org.xvolks.jnative.Type;public class Test {
/**  
 * 加载库文件  
 */
static {
System.out.println(System.getProperty("java.library.path"));
System.loadLibrary("Match");// 把Match.dll复制到tomcat_home/bin   
}
/**  
 *   
 * @param regFinger 采集注册的指纹  
 * @param verFinger 待验证的指纹  
 * @return 返回结果(true:验证通过,false:验证失败)  
 */
public static boolean verFingerByZKOnline(String regFinger, String verFinger) {
System.out.println("1111111");

boolean flag = false;
JNative jna = null;
try {
if (jna == null) {
jna = new JNative("Match.dll", "Process");//调用Mathc中的Process方法   
jna.setRetVal(Type.STRING);
JNative.setLoggingEnabled(true);
}
jna.setParameter(0, Type.STRING, regFinger);//设置Process方法中的第一个参数    
jna.setParameter(1, Type.STRING, verFinger);//设置Process方法中的第二个参数    
jna.invoke();
String val = jna.getRetVal();//获取Process方法的返回值    
if ("65535".equals(val)){
flag = true;
}
} catch (Exception e) {
// TODO: handle exception   
System.out.println("JNative调用Match.dll失败!");
e.printStackTrace();
} finally {
if (jna != null) {
try {
jna.dispose();
} catch (Exception e) {
System.out.println("JNative注销失败!");
}
} }
return flag;
}
}运行后,tomcat直接关闭掉,找到在bin下的错误文件如下:
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x76578dbd, pid=464, tid=1300
#
# Java VM: Java HotSpot(TM) Client VM (11.2-b01 mixed mode windows-x86)
# Problematic frame:
# C  [msvcrt.dll+0x18dbd]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#