We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › opengl applications error. how to fix
Page Index Toggle Pages: 1
opengl applications error. how to fix? (Read 546 times)
opengl applications error. how to fix?
Oct 23rd, 2008, 1:22am
 
i was just trying to follow johnG's doc to create a website for an app that uses opengl online but still i havent got it to work.. looking into java console this is the error i get:

Code:

Exception in thread "Animation Thread" java.security.AccessControlException: access denied (java.io.FilePermission null\data\whitecircle3.png read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sun.opengl.util.texture.TextureIO$StreamBasedTextureProvider.newTextureData(TextureIO.java:1030)
at com.sun.opengl.util.texture.TextureIO.newTextureDataImpl(TextureIO.java:768)
at com.sun.opengl.util.texture.TextureIO.newTextureData(TextureIO.java:183)
at com.sun.opengl.util.texture.TextureIO.newTexture(TextureIO.java:464)
at WeareinHelsinki$XTexture.load(WeareinHelsinki.java:840)
at WeareinHelsinki$XTexture.<init>(WeareinHelsinki.java:756)
at WeareinHelsinki.setup(WeareinHelsinki.java:114)
at processing.core.PApplet.handleDraw(PApplet.java:1377)
at processing.core.PApplet.run(PApplet.java:1305)
at java.lang.Thread.run(Unknown Source)


it breaks write on the first try to load an image as you can see.
im using TextureIO to load textures into opengl (not using PImage).

i was wondering if anyone knows how to work with the file permissions problem.

NOTE: this does not work online, neither it works locally in my PC. its the same error.

thanks in advance
Re: opengl applications error. how to fix?
Reply #1 - Oct 23rd, 2008, 1:40am
 
that 'null' in the pathname looks a bit suspect.

where is the file? how is that path created? is the file there? do you have read permission?
Re: opengl applications error. how to fix?
Reply #2 - Oct 23rd, 2008, 10:26am
 
koogs,

i found that null weird aswell but im not sure what it can be.

the files are in data folder as processing wants it to be, that means a folder called \data inside the sketch folder.

when i export the applet ive placed data folder inside it too, i think that should work.

as for how do i load the files?
i tried 2 ways and none worked for me:

Code:

image = new Texture( "imagename.jpg" );

and

image = new Texture( dataPath("imagename.jpg") );



the files are there yes and i have read permissions for every folder in my server.

but as it does not work locally in my PC, i think the problem might come from somewhere else. just not sure where from :/

do u have any idea that i could try to see if it works ?
Re: opengl applications error. how to fix?
Reply #3 - Oct 23rd, 2008, 10:37am
 
Code:

image = new Texture( "J:\\Processing\\WAIH\\data\\whitecircle3.png" );


this seems to work. i have to give full pathname. hmm.
Re: opengl applications error. how to fix?
Reply #4 - Oct 23rd, 2008, 4:09pm
 
ok i have fixed it by calling TextureIO.newTexture() URL method instead of the File.

the problem is that everytime i want to put a sketch online i have to change the way i load my files :/

i use Ess to load samples and it works just fine. would be cool to know how they load the files using File
Page Index Toggle Pages: 1