Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  JOGL, JApplet and Appletviewer (answer)  (Read 1006 times)
0 Members and 1 Guest are viewing this topic.
Offline Gedden

JGO n00b
*

Posts: 29
Medals: 1



« on: 2009-11-10 11:28:25 »

Im putting this here just so there a reference to the solution online

If you are using the applet viewer for testing a JOGL applet, you may have created a permissions file it could look something like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
grant
{
         permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete";
   permission java.util.PropertyPermission "java.io.tmpdir", "read,write";
   permission java.util.PropertyPermission "jnlp.applet.launcher.tmproot", "read,write";
   permission java.util.PropertyPermission "user.home", "read,write";
   permission java.util.PropertyPermission "sun.jnlp.applet.launcher", "read,write";

   permission java.lang.RuntimePermission "setIO";
   permission java.lang.RuntimePermission "shutdownHooks";  
   permission java.lang.RuntimePermission "getProtectionDomain";
}


Everything launches, but the moment you try and create a GLCanvas, this error comes up:
    Exception in thread "AWT-EventQueue-1" java.lang.ExceptionInInitializerError

This does not look like it, but it is also a permissions error, just unlike anything you have seen because it does not include any information you can use to append to your permissions file. Switch your debug permissions file to this

1  
2  
3  
4  
grant
{
   permission java.security.AllPermission;
}
Offline DzzD

JGO Kernel
*****

Posts: 2134
Medals: 16



« Reply #1 on: 2009-11-10 11:33:57 »

or simply edit ".java.policy" or use the provided policytool in the JRE bin directory and add permission to your Applet only using a codebase like :

grant codeBase "file:/C:/yourAppletDir/" {
  permission java.security.AllPermission;
};

Offline Gedden

JGO n00b
*

Posts: 29
Medals: 1



« Reply #2 on: 2009-11-10 11:56:05 »

Yeah either way. What I wanted was a standalone sandbox that I could check into a repository and have other coders check out. I would argue its easier to create an 'all.policy' file and put the following line in ant
appletviewer index.html -J"-Djava.security.policy=all.policy"

...than hunt down the policy file on whatever system your using and specify a code base in a specific directory, and require every person who checks out the application to do the same for every computer.
Games published by our own members! Go get 'em!
Offline DzzD

JGO Kernel
*****

Posts: 2134
Medals: 16



« Reply #3 on: 2009-11-10 11:59:04 »

sry, my fault, I misunderstood your point, I was thinking that you was arguing to put all permission in global policy...

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.1 seconds with 21 queries.