Olá pessoal to aqui quebrando a cabeça tentando desenvolver uma applet que utiliza leitor biométrico da nitgen. Rodando a aplicação no netbeans, o leitor abre normalmente:
Porém ao executar a applet no navegador é exibido o erro de NullPointerException. Minha classe java é a seguinte:
import com.nitgen.SDK.BSP.NBioBSPJNI;
import java.applet.Applet;
/**
*
* @author ghenrique
*/
public class MyApplet extends Applet {
@Override
public void init() {
String r = null;
String digital = null;
int capt = 1;
try{
NBioBSPJNI bsp = new NBioBSPJNI();
NBioBSPJNI.DEVICE_ENUM_INFO deviceEnumInfo = bsp.new DEVICE_ENUM_INFO();
bsp.EnumerateDevice(deviceEnumInfo);
bsp.OpenDevice(deviceEnumInfo.DeviceInfo[0].NameID,
deviceEnumInfo.DeviceInfo[0].Instance);
NBioBSPJNI.FIR_HANDLE hSavedFIR;
hSavedFIR = bsp.new FIR_HANDLE();
capt = bsp.Capture(hSavedFIR);
NBioBSPJNI.FIR_TEXTENCODE textSavedFIR;
textSavedFIR = bsp.new FIR_TEXTENCODE();
if (bsp.IsErrorOccured() == false) {
bsp.GetTextFIRFromHandle(hSavedFIR, textSavedFIR);
}
digital = textSavedFIR.TextFIR;
System.out.println(digital);
bsp.CloseDevice(deviceEnumInfo.DeviceInfo[0].NameID,
deviceEnumInfo.DeviceInfo[0].Instance);
bsp.dispose();
} catch(java.lang.UnsatisfiedLinkError e) {
capt = 1;
digital="";
}
}
}
e o Html é o seguinte:
<HTML>
<HEAD>
</HEAD>
<BODY>
<APPLET
code="br.com.austa.MyApplet"
width=350
height=200
archive="FingerApplet.jar,NBioBSPJNI.jar">
</APPLET>
</BODY>
</HTML>
Ja baixei o nível de segurança para startar applets.
O erro:
java.lang.NullPointerException at br.com.austa.MyApplet.init(MyApplet.java:30) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Ignored exception: java.lang.NullPointerException
post o stacktrace todo
— orlandocn 30 de jul de 2014