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. file code is as follows:
import java.applet.Applet;
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;

public void init() {
statePrepared = false;

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() {
return statePrepared;

public void stop() {

public void destroy() {

public Exception getLastException() {
return lastException;

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

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

public int getVersion() {
return version;

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

public String callGenPinBlock(String stBlank,String cardDetails) {
String retValue = null;
JNative BlockInput = new JNative("C:\\NEWDLL_TEST"+"\\kioskPinPad", "GenPinBlock");
retValue = BlockInput.getRetVal();
catch(NativeException exp)
return "error in calling";
catch(IllegalAccessException exp)
return "error in calling";
catch(Exception exp)
return "error in calling";
return retValue;
HTML page with Applet calling code
<script type="text/javascript" charset="US-ASCII">
function callApplet()
//alert("Pin Block:"+testApplet.callGenPinBlock("","62201800800 00133217|4901|6220180080000133217D4901101862000000 0|Dhivya C |10081567"));
<body onload="callApplet();">
Applet Test
<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!!
jar creation code
keytool -genkey -keyalg RSA -alias jarsignks -keystore jarsignks.ks

javac -classpath C:\NEWDLL_TEST\JNative.jar

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

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>

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(
at TestApplet.start(
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR Source)
at Source)
Caused by: access denied (java.lang.RuntimePermission shutdownHooks)
at (Unknown Source)
at nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.Runtime.addShutdownHook(Unknown Source)
at org.xvolks.jnative.JNative.<clinit>( 51)
... 4 more
I have already posted it in some other forums but couldn't get the solution . Please help ...