0

For some reason I can't get the variable to be read using JavaScript.

I am using an applet and the errors I get in my Chrome console is:

Uncaught Error: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getenv.processor_identifer")

Uncaught Error: Error calling method on NPObject.

Access code:

<html>
  <head>
      <title>Javascript call Applet example</title>
  </head>
  <body>
      <script type="text/javascript">
        function callSerial() {
            var foo = systemInfo.getSerial();
            console.log(foo);
        }
      </script>
      <center>
          <form>
              <input type="button" value="Call Applet" onclick="callSerial();"/>
          </form>
          <br/><br/>

          <applet id="systemInfo" code="systeminfo.class" width="300" height="50"></applet>

      </center>
  </body>
</html>

Any ideas?

syb0rg
  • 8,057
  • 9
  • 41
  • 81
Rohan Bhangui
  • 353
  • 2
  • 10

1 Answers1

0

Some suggestions:

1) In your applet code, mention code= fully qualified class name. Ie: package.class

2) If your java class is trying to access some file from the local client file system then you will have to get your applet signed like this >> http://www.developer.com/java/data/article.php/3303561/Creating-a-Trusted-Applet-with-Local-File-System-Access-Rights.htm

Regards,

Ravi Trivedi
  • 2,340
  • 2
  • 14
  • 20