Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Experts,

I have made JApplet application for enroll finger print. and placed it on .aspx page as activeX control.

First The code of .aspx is below

---------------------Head Tag-------------------------
C#
<script language="JavaScript" type="text/JavaScript">
<!--
        
        function Enroll() {
            ScanApplet.EnrollFin();
            return false; //// return false for prevent post back of forms
        }
       
//-->
    </script>

---------------------Body and From Tag-------------------------
XML
<script src="http://java.com/js/deployJava.js"></script>

               <script>
           var attributes = {
               id: "ScanApplet",
               code:       "com.futronictech.ScanDemoJApplet",
               archive:    "FtrScanApplet.jar, lib/ftrJniAppletScanAPI.jar, lib/ftrScanAPI.jar, lib/iengine-ansi-iso-1.1.jar, lib/jna.jar",
               width:      178,
               height:     350
           };
           var parameters = {jnlp_href:"launch.jnlp"}; <!-- Applet Parameters -->
           var version = "1.6"; <!-- Required Java Version -->
           deployJava.runApplet(attributes, parameters, version);
               </script>

XML
<input type="submit" value=" Enroll " name="btnEnroll" onclick="return Enroll();">


Now When i Click "btnEnroll" image capture successfully from JApplet, but
after it it shows error like "java.security.Accesscontrolexception access denied"

my applet.policy also contain below code

CSS
grant{
permission java.security.AllPermission;
};


but the problem is still arrives.


code behind is as under
--------------------------------------------------------------------------
C#
public String m_StrFingerTemplate;
private byte[] Enroll_Temp;
m_StrFingerTemplate = new BASE64Encoder().encode(Enroll_Temp);

--------------------------------------------------------------------------
above line giving an error like
"java.security.AccessControllException: access denied("java.lang.RuntimePermission" "accessClassInPackage.sun.mic")"

How Can I Solved It.
Any Help will be appriciated.

Thank you
Mahesh Patel
Posted
Updated 4-May-12 4:56am
v3
Comments
Peter_in_2780 2-May-12 19:19pm    
Wrap the relevant code in a try block and catch the exception. In the catch block, display the message, permission and stack trace from the exception. That will tell you what is failing and where.
Mr. Mahesh Patel 3-May-12 6:38am    
I can not comment that line because it is main line for my motto to make this application.
If the btnEnroll is present in JApplet, then this line works fine and clear my motto, but in my case the btnEnroll is present on my web form. so the security issue arrives.

it is also working fine with .net ActiveX control, but i need it to built in JApplet.

I want to fix that security issue.

can Any one help me.....?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900