File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes SecurityException in my Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "SecurityException in my Applet" Watch "SecurityException in my Applet" New topic
Author

SecurityException in my Applet

Lucas Germano
Greenhorn

Joined: Jul 16, 2012
Posts: 7
When I run my Applet in a simple HTML page, occurs the following error

SecurityException: Trusted loader attempted to load sandboxed resource from file : C:/Users/lucas/teste.jar


I follow the tutorial but in the step 7, i got the following error

Could not open file policy C:\Program Files\Java\jdk1.7.0_05\bin\raystore: sun.security.provider.PolicyParser$ParsingException line 1: expected [;] found[pípí]

Maybe I'm doing something wrong in the step 7, because I don't understand what to do in step 7
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41905
    
  63
Post the contents of the policy file.


Ping & DNS - my free Android networking tools app
Lucas Germano
Greenhorn

Joined: Jul 16, 2012
Posts: 7
I don't understand so much about Java, so I have some difficult with that. How can I show you the content of a policy ?

I don't know what to do in policytool

How can I do ? What i have to do ins this step 7 ?

I just want to put my Applet to run in my Web Application, but occurs the SecurityException
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41905
    
  63
This is a file, and its contents are apparently causing a problem: C:\Program Files\Java\jdk1.7.0_05\bin\raystore

If we knew what's in the file, we might be able to help.
Lucas Germano
Greenhorn

Joined: Jul 16, 2012
Posts: 7
But how can I put the content of this file ?

When I open the file with Notepad++ or notepad, Just open some special caracter
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41905
    
  63
Well, that's a problem, then. Your JVM is apparently set up to expect a security policy in that file; if there's anything else in it, that's a problem. Was that file altered at all? What's the last modified date on it?
Lucas Germano
Greenhorn

Joined: Jul 16, 2012
Posts: 7
Well, when I put the <APPLET> tag in my web application, I receive the SecurityException, and then, I was instruct to follow this tutorial, but in the step 7, I don't know what to do, I'm trying to open the file that was created in this tutorial through the policytool.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41905
    
  63
Was that file altered at all? What's the last modified date on it?
Lucas Germano
Greenhorn

Joined: Jul 16, 2012
Posts: 7
Last update 2012-07-16 16:15
Lucas Germano
Greenhorn

Joined: Jul 16, 2012
Posts: 7
Now I got the ExceptionInInitualizerError,

When I try to run my html with the applet, I got a alert warning telling that
Java found some app components that is a security problem. Block this execution ?
I put no.

And after that occurs ExceptionInInitualizerError

In localhost (without HTML), works fine,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41905
    
  63
That is a very recent timestamp; seems like you changed something (maybe inadvertently) that confuses the policy file system.

The parsing exception goes along with the ExceptionInInitualizerError? Or is that a different problem?
Lucas Germano
Greenhorn

Joined: Jul 16, 2012
Posts: 7
This is a different exception, that occurs when I put to ignore the SecurityException.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SecurityException in my Applet