There are two jar files .I am trying to access JNative.jar from our TestApplet.jar. I have downloaded JNative.jar form some site. Purpose of Jnative.jar is to access the dll. If I try from eclipse as a standalone code, it will call the dll and give me the response but when I am trying it from applet its not working.
We have signed both the jars i.e. our Testapplet.jar and downloaded JNative.jar. Here our aim to access the dll which will create the pinblock and give it to me.

TestApplet.java file code is as follows:
import java.applet.Applet;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Formatter;
import org.xvolks.jnative.JNative;
import org.xvolks.jnative.Type;
import org.xvolks.jnative.exceptions.NativeException;

public class TestApplet extends Applet {
private static final int version = 11;

private static Boolean synchro = new Boolean(true);

private Exception lastException;

private String passwordCipher;

private int symCipherKeySize;

private boolean debug;

private boolean raiseExceptions;

private String signature;

private boolean persistPrivateKey;

private boolean statePrepared;

private String stMacAddress;

private String stNewWorkKey;

private String stCardDetails;

@Override
public void init() {
System.out.println("initializing");
statePrepared = false;
}

@Override
public void start() {
System.out.println("Start method()");
try {
System.out.println("Pin Block:"+callGenPinBlock("","6220180080000133217|49 01|6220180080000133217D49011018620000000|Dhivya C |10081567"));
}catch(Exception e) {
System.out.println("Exception in callGenPinBlock() :"+e);
}
}

public boolean isPrepared() {
System.out.println("isPrepared()");
return statePrepared;
}

@Override
public void stop() {
System.out.println("stopping");
}

@Override
public void destroy() {
System.out.println("destroying");
}

public Exception getLastException() {
return lastException;
}

public String getLastExceptionStackTrace() {
if (lastException == null) {
return null;
} else {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw, true);
lastException.printStackTrace(pw);
pw.close();
return sw.toString();
}
}

private void handleException(Exception e) throws Exception {
lastException = e;
if (raiseExceptions) {
throw e;
} else {
e.printStackTrace();
}
}

public int getVersion() {
return version;
}

public String getJavaVersion() {
return System.getProperty("java.version");
}

public String callGenPinBlock(String stBlank,String cardDetails) {
String retValue = null;
try
{
JNative BlockInput = new JNative("C:\\NEWDLL_TEST"+"\\kioskPinPad", "GenPinBlock");
BlockInput.setRetVal(Type.STRING);
BlockInput.setParameter(0,stBlank);
BlockInput.setParameter(1,cardDetails);
BlockInput.invoke();
retValue = BlockInput.getRetVal();
BlockInput.dispose();
}
catch(NativeException exp)
{
exp.printStackTrace();
return "error in calling";
}
catch(IllegalAccessException exp)
{
exp.printStackTrace();
return "error in calling";
}
catch(Exception exp)
{
exp.printStackTrace();
return "error in calling";
}
return retValue;
}
}
HTML page with Applet calling code
<html>
<head>
<script type="text/javascript" charset="US-ASCII">
function callApplet()
{
//alert("Pin Block:"+testApplet.callGenPinBlock("","62201800800 00133217|4901|6220180080000133217D4901101862000000 0|Dhivya C |10081567"));
}
</script>
</head>
<body onload="callApplet();">
Applet Test
</body>
<applet name="testApplet" code="TestApplet" archive="TestApplet.jar" width="0" height="0" mayscript="true">
<param name="debug" value="true" />
<param name="raiseExceptions" value="false" />
No Java support for APPLET!!
</applet>
</html>
jar creation code
keytool -genkey -keyalg RSA -alias jarsignks -keystore jarsignks.ks

javac -classpath C:\NEWDLL_TEST\JNative.jar TestApplet.java

jar cvfm Test.jar MANIFEST.txt TestApplet.class

jarsigner -keystore jarsignks.ks -storepass santanu -keypass santanu TestApplet.jar jarsignks

jarsigner -keystore jarsignks.ks -storepass santanu -keypass santanu JNative.jar jarsignks

pause
Manifest file
As we will keep this jar at this place,
Class-Path: /C:/NEWDLL_TEST/JNative.jar

In java console exception it's displayed as,
Java Plug-in 1.6.0_22
Using JRE version 1.6.0_22-b04 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\353323

----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

initializing
Start method()
Entry san getMacAddress
mac address from applet:6C:F0:49:28:52:66
Exception in thread "thread applet-TestApplet-1" java.lang.ExceptionInInitializerError
at TestApplet.callGenPinBlock(TestApplet.java:169)
at TestApplet.start(TestApplet.java:65)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission shutdownHooks)
at java.security.AccessControlContext.checkPermission (Unknown Source)
at java.security.AccessController.checkPermission(Unk nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.Runtime.addShutdownHook(Unknown Source)
at org.xvolks.jnative.JNative.<clinit>(JNative.java:3 51)
... 4 more
I have already posted it in some other forums but couldn't get the solution . Please help ...