security proble with the applet

Ok, I’ve recently posted about trying to create an applet.
I took a look at how I can create the applet in NetBeans 4.0.
Appletviewer reports the applet as loaded, but after a second or two I get this exception:

java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at sun.applet.AppletSecurity.checkAccess(AppletSecurity.java:159)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:310)

I think this happens because I set up a thread to run somethings. How can I grant full access to my applet?
Weird thing is IE opens the applet, but doesn’t do some things (doesn’t load a texture it’s supposed to. I read about a java.policy file something. How do I use this and does NetBeans understand it automatically? Thanks

I don’t know exactly about netbeans.

But normally in the in your java runtime directlory there should be a subdirectory lib/security/

in this folder there is a java.policy file, you just need to edit it and add the permission you need. But be aware that this will only solve the problem on your machine.

I have read on the net that you can compile your files and specify a different security manager than the standard one to give your programs the permissions it needs.

Yes, but to change the securityManager, you first have to edit your policy file …

Alternatively, you can sign your applet : it’s not that hard, and if you’re used to ANT, there are some built-in tasks to help you.

Lilian

Thanks guys, using a .java.policy file in my home directory solved the problem. But my problem now is the image loader. I want to use a rather large texture (up to 5000x5000). I tried a tutorial but I got hit and miss results. Now I’m using the png loader from NeHe’s lessons 06 port for jogl. It works fine for their image, but when I create an image of my own, either in Photoshop or in MS Paint the image won’t load. Can someone shine a light on this?

Hi,

Simple question, not an answer sorry, but are you sure your video card will support a 50005000 texture… Some cards only support 20482048 textures or 4096*4096…

How about trying to tile this up…

Yep, the card goes up to 2048. I had no idea that there was a limit to the size of the texture (apart from memory issues). I gues we need to tile the application to get to a higher resolution. Thanks again!

Hi

To stay in the same category of security, i got an application that read file locally and also need to access full screen mode and exit mode. I grant it all permissions from jnlp header and signed my Jar file.

But when trying to run it, after accepting certificate i got a problem telling me that i can not run the application because it is lacking some permission to read directory… Any one knows what can be the problem? when signing jar file, am i wrong to think that all the files from archive are also signed?