I currently have the applet embedded into a webpage and I wish to create a bitmap of the model to store and call back up elsewhere in my web application.
When I call the function that should do the convert I get the following:
Uncaught Error: java.security.AccessControlException: access denied ("java.io.FilePermission" "TestFile.bmp" "write")
Currently I was just aiming to save the file near the applet on the server so haven't included an output directory or anything like that, the same error still appears however when I try full paths to either my local machine or relative paths elsewhere on the server etc.
The code I am using is below, am I missing any extra steps out or is there something I can do to give the applet the correct permissions to do this?
var convertOptionsClass = jApplet.getClass("com.cimmetry.core.ConvertOptions3D");
var convertOptions = convertOptionsClass.newInstance();
Edited by: 986996 on Feb 22, 2013 2:57 AM
It is likely that your JVM does not have enough permissions (<JRE>\lib\security\java.policy).
Try adding permission java.security.AllPermission; in the grant block to check if it helps.
There are other alternatives that you might consider for your application:
- jApplet.getActiveVueBean().renderOntoGraphics() to render onto a graphics created from an image.
- Using our Web Servises to convert or to generate a thumbnail.