Hello All
Can someone please give me some guidance here?
I am trying to get some
java code working in NetBeans 6.1 (platform is JDK 1.6.0_13 - latest I think). The code is a sample from ACS for their ACR122U NFC smart card reader.
If I use a browser (IE7 - same JDK version) - the sample
applet all works fine.
I can also use command line ("java <app>.class") and it works fine too
BUT
If I use the corresponding sources and build a NetBeans 6.1 project - they cease working. There is a link error:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: activesample.JacspcscLoader.SCardEstablishContext(IIII)I
at activesample.JacspcscLoader.SCardEstablishContext(Native Method)
at activesample.JacspcscLoader.jSCardEstablishContext(JacspcscLoader.java:31)
at activesample.ActiveSample.actionPerformed(ActiveSample.java:191)
I have the JacspcscLoader.java source file - this has a static System.LoadLibrary call in it..:
static {
System.loadLibrary("Jacspcsc");
}
...and it also declares all the native methods, e.g.
public int jSCardEstablishContext(int dwscope, int pvReserved1, int pvReserved2, int [] phContext)
{
ret = SCardEstablishContext(dwscope, pvReserved1, pvReserved2, hContext);
phContext[0] = hContext; //return value of hContext;
return ret;
};
The Jacspcsc.dll is present and on the path. It is the latest version from the supplier and is in WINDOWS/System32 which is on the path - this is the only instance of the dll on the system.
So, it is found and loaded ok. And must be working ok for the browser command line versions to work properly.
BUT, it will not work with NetBeans !!
Any ideas why it is ok from the browser applet, or from the command line but NOT from NetBeans? Is there some bizarre thread, sharing, minutiae, detail that needs to be tinkered with or something more simple perhaps???
The only thing I did to JacspcscLoader (wrapper file) was to add it to the same package as the application by adding the line "package activeSample;". Has this introduced a scope issue or is that a red herring....?
All help very welcome indeed.
Does anyone have any alternate suggestions to get up an running (I think I just need a PC/SC stack to call from java...?)
With many thanks
Cheers
Pete