Java.io.FilePermission + Flex :(

Hi Guys,
i have a very strange problem and hope that u can help me. J
I am developing an Air-App using a Coldfusion (Hoster is hostek.com) Backend. The Application has a User-Login which works correctly.
After the login the app calls the server to get a full list of all members to display them into a Datagrid…
Problem: On my localmashine both is working great. “Online” just the login works great… Calling the “getTeam” method causes an error:
Error Loading team: [RPC Fault faultString="access denied (java.io.FilePermission D:\home\website.com\wwwroot\projects\teamplaner\Member.cfc read)"
I just don’t get, why login works super and the other function (is in the same cfc) isn’t working.
Again: local both is working…
Any ideas? L
Greetings from germany,
nico

STRANGE:
I "solved" it...
I am using customObjects in my application and on the server. (remoteClass....) If i am parsing an Object of that type to the function on the server there are no problems.... (of course this make sense if i am calling the "login" function... there i am parsing a UserVO instance containing username/password)
anyway...
in the "getTeam" method there is obviously no cfargument, just a returntype. (i am calling all users, without any specific propertys)
Now i parsed an empty instance of that "UserObject" to my Cfc.component... Voila no error and i get the results i want....
It seems that the server just "know" the objects i am parsing... doesn't make any sense for me.
WTF? WHY?
greets, nico

Similar Messages

  • Java.io.filepermission error while executing a batch file from java prog

    Hi,
    i want run a java program which executes a batch file, both are in a jar file. while am trying this using webstart it shows error:access denied java.io.filepermission <<ALL FILES>>execute. why this happens how to rectify this.
    By
    Vinod

    Clearly, it would be a security vulnerability to be able to do such a thing from the web w/o user granting trust to the application.
    Java Web Start applications run in the Java SE secure sandbox unless they have been granted all-permissions by the user:
    1.) sign all jar files.
    2.) add <security><all-permissions/></security> to the jnlp file.
    The user would then be prompted to grant trust to the applications.
    /Andy

  • Java.io.FilePermission error while writing file to disk

    Hi All,
    I have done a simple JSP form in which am uploading a file to the server, am using apache commons file upload, in my local system its working fine(windows), but when i uploaded the same to the shared server(Linux), tomcat throwing a exception when java class file trying to write the file to disk, i have given all permissions (read,write,execute) to all users to the target folder("timeSheet_uploadedFiles") where am trying to write the file and tried but no luck still the exception continues, below i copied the exception am getting, somebody please help me.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: access denied (java.io.FilePermission /var/chroot/home/content/html/timeSheet_uploadedFiles/admin_4_5_CSharp Coding Standards.pdf write)
         org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:266)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)
    root cause
    java.security.AccessControlException: access denied (java.io.FilePermission /var/chroot/home/content/html/timeSheet_uploadedFiles/admin_4_5_CSharp Coding Standards.pdf write)
         java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         java.security.AccessController.checkPermission(AccessController.java:427)
         java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
         java.io.FileOutputStream.<init>(FileOutputStream.java:169)
         java.io.FileOutputStream.<init>(FileOutputStream.java:70)
         com.roots.UploadAction.upload(UploadAction.java:72)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
         org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:266)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.
    Apache Tomcat/5.0.27Thanks,
    vyrav.

    You have apparently missed setting the write permission to the target directory for the user that Tomcat is running as. Tomcat may be running as a different user than the one you are logged into on the system.
    It may be trying to save to an incorrect location, so double check the directory is what you expect it to be.
    The file may already exist, so it may not be able to over-write the file, so make sure you give the tomcat user the ability to delete and overwrite as well as write - or check if the file exists before writing and warn user if you don't want to give delete permissions.

  • Access denied (java.io.FilePermission c:\hello.html read

    hi all,
    i'm trying to run an application in web start which runs otherwise absolutely fine.i have made a tree application .if i press a link in a node it opens another page in jeditor pane which is on the other side of the split pane.every time i try to open a page it gives me the following exception
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied (java.io.FilePermission c:\Program Files\Apache Tomcat 4.0\webapps\web\hello.html 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.File.isDirectory(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.initializeHeaders(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getHeaderField(Unknown Source)
         at sun.net.www.URLConnection.getContentType(Unknown Source)
         at javax.swing.JEditorPane.getStream(Unknown Source)
         at javax.swing.JEditorPane.setPage(Unknown Source)
         at browser.HelpPanel.displayURL(HelpPanel.java:156)
         at browser.HelpPanel.access$000(HelpPanel.java:37)
         at browser.HelpPanel$2.valueChanged(HelpPanel.java:74)
         at javax.swing.JTree.fireValueChanged(Unknown Source)
         at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source)
         at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source)
         at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source)
         at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(Unknown Source)
    i have given permissions for file io in jdk1.3 jre,tomcat 's catalina as well as in the java.policy file for this particular application which is in the jar folder but no use.can anybody tell me the solution.following is the content of my policy file.
    grant {
    permission java.net.SocketPermission "*:1024-65535",
    "connect,accept,resolve";
    permission java.net.SocketPermission "*:80", "connect";
    permission java.security.AllPermission;
    permission java.util.PropertyPermission "os.name", "read";
         permission java.util.PropertyPermission "os.version", "read";
         permission java.util.PropertyPermission "os.arch", "read";
         permission java.util.PropertyPermission "file.separator", "read";
         permission java.util.PropertyPermission "path.separator", "read";
         permission java.util.PropertyPermission "line.separator", "read";
    permission java.util.PropertyPermission "user.dir", "read";
    permission java.util.PropertyPermission "dir", "read";
    permission java.io.FilePermission "c:\Program Files\Apache Tomcat 4.0\webapps\web\", "read,write,execute";
    thanks

    Hi sangeeta,
    I am working on java web start and have posted a query at the following link
    http://forum.java.sun.com/thread.jsp?forum=38&thread=328294
    I read your question and I found it similar to my problem.
    I was wondering if you could temm me exactly what file you had to modify under web start and what was the line that you had to put in.
    If the question is ambiguous .... and as an after thot it does look kinda that way please lemme know.
    Thanks
    Shahid
    hi all,
    i'm trying to run an application in web start which
    runs otherwise absolutely fine.i have made a tree
    application .if i press a link in a node it opens
    another page in jeditor pane which is on the other
    side of the split pane.every time i try to open a page
    it gives me the following exception
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied
    (java.io.FilePermission c:\Program Files\Apache Tomcat
    4.0\webapps\web\hello.html read)
    at
    java.security.AccessControlContext.checkPermission(Unk
    own 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.File.isDirectory(Unknown Source)
    at
    sun.net.www.protocol.file.FileURLConnection.connect(Un
    nown Source)
    at
    sun.net.www.protocol.file.FileURLConnection.initialize
    eaders(Unknown Source)
    at
    sun.net.www.protocol.file.FileURLConnection.getHeaderF
    eld(Unknown Source)
    at sun.net.www.URLConnection.getContentType(Unknown
    Source)
         at javax.swing.JEditorPane.getStream(Unknown Source)
         at javax.swing.JEditorPane.setPage(Unknown Source)
         at browser.HelpPanel.displayURL(HelpPanel.java:156)
         at browser.HelpPanel.access$000(HelpPanel.java:37)
    at
    browser.HelpPanel$2.valueChanged(HelpPanel.java:74)
    at javax.swing.JTree.fireValueChanged(Unknown
    Source)
    at
    javax.swing.JTree$TreeSelectionRedirector.valueChanged
    Unknown Source)
    at
    javax.swing.tree.DefaultTreeSelectionModel.fireValueCh
    nged(Unknown Source)
    at
    javax.swing.tree.DefaultTreeSelectionModel.notifyPathC
    ange(Unknown Source)
    at
    javax.swing.tree.DefaultTreeSelectionModel.setSelectio
    Paths(Unknown Source)
    i have given permissions for file io in jdk1.3
    jre,tomcat 's catalina as well as in the java.policy
    file for this particular application which is in the
    jar folder but no use.can anybody tell me the
    solution.following is the content of my policy file.
    grant {
    permission java.net.SocketPermission
    ion "*:1024-65535",
    "connect,accept,resolve";
    permission java.net.SocketPermission "*:80",
    0", "connect";
    permission java.security.AllPermission;
    permission java.util.PropertyPermission
    ssion "os.name", "read";
    permission java.util.PropertyPermission "os.version",
    "read";
    permission java.util.PropertyPermission "os.arch",
    "read";
    permission java.util.PropertyPermission
    "file.separator", "read";
    permission java.util.PropertyPermission
    "path.separator", "read";
    permission java.util.PropertyPermission
    "line.separator", "read";
    permission java.util.PropertyPermission
    ssion "user.dir", "read";
    permission java.util.PropertyPermission "dir",
    dir", "read";
    permission java.io.FilePermission "c:\Program
    ogram Files\Apache Tomcat 4.0\webapps\web\",
    "read,write,execute";
    thanks

  • Why signed and get "access denied (java.io.FilePermission hello.txt read)"?

    I am learning the Java tools and policy to create some local browser application for personal use. So I signed a jar file with jarsigner, keytool and policytool and still trying to figure out why my browser application cannot read a simple local text file.
    My question are
    1. Why use java policy tool (policytool.exe)? If I signed a .jar with keytool and jarsigner, do I really need java policytool to write a policy?
    2. What is the maximum validity days? 365? or more? Do I need to sign again when validity expire?
    3. I don't want any of my local browser application gets to internet but only work with local files (read, write, or execute). how do I do that?
    4. how to use java security policy to grant access to the jar applet? where do I place and import the policy file so the hosting web browser and the applet can work?
    My java applet is a simple class that read a text line from a local file in the same folder, and pass the result to a calling web browser Javascript.
    Currently the result in the web page is the error message below, even though the jar is signed correctly.
    access denied (java.io.FilePermission hello.txt read)
    Someone please help and enlight the newbie!

    leoku wrote:
    I am learning the Java tools and policy to create some local browser application for personal use.Why would you wrap a mostly useless and unhelpful browser window around a Java app. for 'local' use?
    .. So I signed a jar file with jarsigner, keytool and policytool and still trying to figure out why my browser application cannot read a simple local text file.
    My question are
    1. Why use java policy tool (policytool.exe)? If I signed a .jar with keytool and jarsigner, do I really need java policytool to write a policy?No. In fact, don't stuff around with policy files - they are a path to madness.
    2. What is the maximum validity days? 365? or more?Keytool accepts an argument for the number of days to remain valid. I do not believe it has an upper limit, but it might be best to experiment with it and find out for yourself. Please report your findings back.
    (2a) Do I need to sign again when validity expire?No, but the end user gets a huge warning that the certificate has expired. Further, if it was a certificate that was certified by a CA, the 'always trust' check box which used to default to true, would now default to false.
    3. I don't want any of my local browser application gets to internet but only work with local files (read, write, or execute). how do I do that?I am not sure I understand, but if you only offer a JFileChooser for the applet to access resources, that should restrict it to resources off the local file-system. Of course, that would not restrict the end user from downloading something from the internet to their local disks, then accessing it using the applet.
    4. how to use java security policy to grant access to the jar applet? where do I place and import the policy file so the hosting web browser and the applet can work?The only place it will work is in the JRE directories of the end-user's machine. Even if you find a way to install your local policy file, do not go messing with the end-user's policy files.
    My java applet is a simple class that read a text line from a local file in the same folder,.. In the 'same folder' as what? (1)
    ..and pass the result to a calling web browser Javascript. That might be the problem. AFAIR, using JS with trusted applets causes the security to be tightened. Perhaps it could be fixed by calling System.setSecurityManager(null) on applet init(), but I have also seen references to using [AccessController.doPrivileged()|http://java.sun.com/j2se/1.4.2/docs/api/java/security/AccessController.html] to wrap the problematic code. I am hazy on the details of how/if that works.
    Currently the result in the web page is the error message below, even though the jar is signed correctly.
    access denied (java.io.FilePermission hello.txt read)
    1) If the answer to my question is what I suspect, there may be better ways to access the resource that are usable even in a sand-boxed app.

  • Java.io.FilePermission

    I am baffled by a security.AccessControlException that I get when I try to start an RMI server.
    The server sets an RMISecurityManager(), then creates an engine that extends UnicastRemoteObject and attempts to bind it (on localhost) with Naming.rebind(...). There it fails:
    RemoteCalcServer exception: access denied (java.io.FilePermission \\C\Projects\OmegaClient\classes read)
    java.security.AccessControlException: access denied (java.io.FilePermission \\C\Projects\OmegaClient\classes read)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:354)
         at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
         at java.rmi.Naming.rebind(Naming.java:160)
    at com.tibotec.isclient.calc.server.RemoteCalcServer.main(RemoteCalcServer.java:52)
    The policy file is:
    grant codeBase "file://C:/Projects/OmegaClient/classes/-" {
    permission java.io.FilePermission "\\C\\Projects\\OmegaClient\\classes\\", "read";
    permission java.net.SocketPermission "localhost:1024-", "listen, accept, connect";
    It must be correctly loaded and used, because a (different) exception is generated when I comment out the SocketPermission. But why does RMI complain about not having reading permission on that directory (the codeBase, and its value must be correct, or else I should get ClassNotFound exceptions)?
    I have tried every almost imaginable change to the directory syntax, including including "C:\\-", "file://C:/-", and "<<ALL FILES>>" but those don't help...
    Emmanuel

    did you find out what the problem was in the end??
    Im in a similar predicament.
    Decided i would have a look at some of the tutorials so i took the nice and easy hello world.
    You can find it here
    http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html
    Anyways when it comes down to running it i run into all sorts of problems. Im using the jdk1.5 Update 13.
    I trying to run both the server locally on my machine. My first exception i run into is
    (Package name differs slightly to the example but everything else is the same)
    Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: hello.Hello
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: hello.Hello
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown
    Ok all class files are there and sit in the same package and tells me it cant find the Hello class. So i then set the
    Djava.rmi.server.codebase attribute to my classes directory. So then i move onto to my next exception
    Server exception: java.security.AccessControlException: access denied (java.io.FilePermission \\c\eclipse\workspace\helloworld\bin read)
    java.security.AccessControlException: access denied (java.io.FilePermission \\c\eclipse\workspace\helloworld\bin read)
    So i then create a policy file and grant all access.(Which im thinking i shouldnt be doing this because everything is local)
    So i then specify it on the command line Djava.security.policy= grant all policy
    Still get the same problem, what i dont get is why i need this when i run everything local, my understanding is that if you run it locally you dont need to specify a security policy file and codebase.
    if gives no indication in the tutorial either that you need this. Anyone any ideas how i can get this simple thing to work!!
    Cheers,
    LL

  • GWT meets  Flex:  Java API  for Flex

    Hello people,
    I m  somedays away to release the  version 2.1 of gwt4air. gwt4air is an open source project  based on  gwt (http://code.google.com/webtoolkit/)  and provides a Java API to different platform where Java is not the primary language.
    Version 2.0 added among other features  support for Adobe AIR, Alive PDF, Pure PDF, Aswing and other GWT based  UI libraries like  EXT-GWT
    With version 2.1  i added support for Flex(AIR and Browser). The goal of this approach is to make it easy for Java Developers to switch  to Flex be leveraging  a swing like API. But also to  present an alternative to the classical Flex developement. The overall idea behind this is described here:
    http://code.google.com/p/gwt4air/wiki/Beginn
    A demo application ca be found here: http://gwt4air.appspot.com/
    The application contains around 100 demos with source code illustrating the use of the api.
    I ve tried to keep the API similar to the AS3 api  so one could easely  switch from AS3 to Java and vice versa
    Note that this  flex applicaton is entirely written in Java using gwt4air. No AS3 no MXML.
    The application is still in alpha stage so please expect some errors.
    The project home is located at:
    http://code.google.com/p/gwt4air/
    I m looking forward to hear what you think about this idea. Any inputs (good or bad)  is really welcome
    Help me make this an even better tool.
    It s about time that  Flex rocks the GWT world
    cheers,
    Alain

    It looks like those genius @google are also thinking about a Java(GWT) API for Flash .
    http://www.youtube.com/watch?v=F_sbusEUz5w&t=1718
    Glad to see  that i m not a fool
    Or alteast not the only fool that believe  combining  Java and Flash/Flex is a potent mix.

  • Java objects to Flex

    Hopefully this is the right forum, if not pleas accept my
    apologies.
    We need to return dollars and percent type numbers from java
    back to Flex using the BlazeDS interface.
    When I create a Java test object to return that looks like:
    public class Test2 implements Serializable{
    private String abc = "abc";
    private Date sqlDate;
    private Time sqlTime;
    private Timestamp timestamp;
    private BigDecimal bd;
    private float lFloat;
    private Float bFloat;
    private double lDouble;
    private Double bDouble;
    The constructor fills in values and the java server (JBoss)
    returns the object back to Flex. The matching flex object looks
    like:
    [Bindable]
    public class Test2
    public var abc:String;
    public var sqlDate:Date;
    public var sqlTime:Date;
    public var timestamp:Date;
    public var bd:Number;
    public var lFloat:Number;
    public var bFloat:Number;
    public var lDouble:Number;
    public var bDouble:Number;
    } /* Test2*/
    when I print out the returned object using the trace command,
    I get:
    ReferenceError: Error #1056: Cannot create property BFloat on
    jdbcTables.businessdelegate.Test2.
    ReferenceError: Error #1056: Cannot create property LFloat on
    jdbcTables.businessdelegate.Test2.
    ReferenceError: Error #1056: Cannot create property LDouble
    on jdbcTables.businessdelegate.Test2.
    t2.bd=3.03
    t2.lFloat=NaN
    t2.bFloat=NaN
    t2.lDouble=NaN
    t2.bDouble=NaN
    If I read
    http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDo cs_Parts&file=00001103.html
    correctly these fields should be converted properly.
    Am I missing something or is the web page wrong? Is there
    another kind of Java object can I use to return a floating point
    number, I really don't like BigDecimal, it's sooo expensive.
    Thanks
    Bill Tims

    Ok, I figured out THIS problem. The real issue is the
    capitalization of the name. If I use an upper case character as the
    2nd character, blaze and flex don't see that they are variable,
    i.e. aBcd as a variable name doesn't work, whereas abcd does work.
    Since this problem doesn't appear on the PHP side, I'm guessing the
    problem is on the Blaze side.

  • Can't run applet with appletviewer(java.io.FilePermission)

    Guys, I am writing an applet and it has compiled fine but when I try running it with appletviewer, it spews out these error. I have changed permissions on my .class file and .html file.
    Can anyone help? It's pretty frustrating...
    ava.security.AccessControlException: access denied (java.io.FilePermission /.automount/blah/usr/blah/blah/Node.class read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:399)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:890)
    thanks.

    See if you find anything here:
    http://search.java.sun.com/search/java/index.jsp?col=javaforums&qp=%2Bforum%3A31&qt=%22java.security.AccessControlException%3A+access+denied+%22&x=17&y=14
    It�s a search on the forum, users with the same error.
    Andreas

  • Java.io.FilePermission Error

    So i am getting the following error when I attempt to upload a picure into my applet from my system. The applet has been signed and it does ask if I will accept the certificate. Yet I still get the error shown below. When I edit my java.policy file to allow all permissions it does work. So what do I need to do to make this work. Sort of useless if other can't upload stuff into my applet.
    java.security.AccessControlException: access denied (java.io.FilePermission C:\Users\Philip DePalo\Documents\_TricksTrade\phil.jpg 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.File.isFile(Unknown Source)
         at org.apache.commons.httpclient.methods.multipart.FilePartSource.<init>(FilePartSource.java:67)
         at org.apache.commons.httpclient.methods.multipart.FilePart.<init>(FilePart.java:129)
         at ThumbnailHandler$UploadImage.actionPerformed(ThumbnailHandler.java:369)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at java.awt.Component.show(Unknown Source)
         at java.awt.Component.setVisible(Unknown Source)
         at java.awt.Window.setVisible(Unknown Source)
         at java.awt.Dialog.setVisible(Unknown Source)
         at ThumbnailHandler$UploadImage.<init>(ThumbnailHandler.java:353)
         at ThumbnailHandler$1.actionPerformed(ThumbnailHandler.java:107)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at SessionClient$MenuItemListener.actionPerformed(SessionClient.java:500)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    public void actionPerformed(ActionEvent e) {     
                try{
                    Object source = e.getSource();
                    if (source == okBtn) {
                       final PostMethod filePost = new PostMethod(uploadServer);
                        int listSize= fileListModel.size();
                        if (listSize <= 0) return;
                        try {
                            final Part[] parts= new Part[listSize];
                            for (int i=0; i<listSize; i++) {
                                File targetFile= new File((String)fileListModel.get(i));
                                parts= new FilePart(targetFile.getName(), targetFile);
    String strQuery= "tId=" + topicId
    + "&uploadPath=" + uploadPath;
    final String queryString= strQuery.replace(' ', '+');
    filePost.setQueryString(queryString);
    filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams()));
    HttpClient client = new HttpClient();
    client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
    int status = client.executeMethod(filePost);
    if (status == HttpStatus.SC_OK) {
    String strImage[];
    Vector fileList= new Vector();
    String str= filePost.getResponseBodyAsString();
    strImage= str.split(";");
    for (int i=0; i<strImage.length; i++){
    fileList.addElement(strImage[i]);
    addImages(fileList);
    JOptionPane.showMessageDialog(mainFrame, "Upload Images Successfully!"
    +System.getProperty("line.separator")
    +str);
    } else {
    JOptionPane.showMessageDialog(mainFrame, "Upload Images Fail!");
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    filePost.releaseConnection();
    uploadDialog.dispose();
    else if (source == cancelBtn) {
    uploadDialog.dispose();
    else if (source == addFileBtn) {
    File[] selFiles;
    String pathStr, nameStr;
    selFiles= fc.getSelectedFiles();
    for (int i=0; i<selFiles.length; i++) {
    if (selFiles[i].isFile()) {
    pathStr= selFiles[i].toString();
    nameStr= selFiles[i].getName();
    if (!fileListModel.contains(pathStr)) {
    fileListModel.addElement(pathStr);
    fc.setSelectedFiles(null);
    else if (source == delFileBtn) {
    int[] selectedIndices= fileList.getSelectedIndices();
    for (int i=selectedIndices.length-1; i>=0; i--) {
    fileListModel.removeElementAt(selectedIndices[i]);
    } catch (Exception aa) {
    System.out.println(aa);

  • Java.io.FilePermission weirdness

    Hi;
    I have set java.policy as:
         permission java.io.FilePermission "/windows/fonts/*", "read";
         permission java.io.FilePermission "\\windows\\fonts\\*", "read";
         permission java.io.FilePermission "c:/windows/fonts/*", "read";
         permission java.io.FilePermission "c:\\windows\\fonts\\*", "read";
    And yet I still get:
    java.security.AccessControlException: access denied (java.io.FilePermission c:\windows\fonts read)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:
    401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
    at java.io.File.list(File.java:904)
    at java.io.File.list(File.java:937)
    at net.windward.util.RegisterFonts.registerFonts(RegisterFonts.java:102)
    The one thing that is unusual - there is no c:\windows\fonts directory on my computer. (I have c:\winnt\fonts). But I should still be able to try a read to see if anything is there.
    Any ideas?
    thanks - dave

    And the answer is "c:/windows/fonts/*" is the files in that directory while "c:/windows/fonts" is being able to do a dir of the directory.

  • Wildcards and java.io.FilePermission???

    I realize I can use a "-" or "*" at the end of my pathname. Can I use one in the middle?
    I have approximately 1,200 user webs that I'd like to enable for JSPs with Jakarta Tomcat. I'd like each user to have write access to a /webdata folder withing their web:
    permission java.io.FilePermission "d:\\Inetpub\\Wwwroot\\dev\\jtest\\students\\-\\webdata\\-", "read, write";
    The directory name between students and webdata will be different for each student. Howdo I handle a varying directory name in the middle of the path?
    Any suggestions?

    You realize that you can use wildcards with FilePermission.
    Did you really test it for let's say one user, like:
    grant codeBase "file:${catalina.home}/webapps/examples/-" {
    permission java.io.FilePermission "d:\\somepath\\-", "read, write";
    Because I never succeeded in using wildcard with FilePermission.
    Wildcards work well for PropertyPermission.
    Dany
    [email protected]

  • Sending Java Objects to Flex

    Hi All ,
       I have a Flex+Java Application , which is running fine , and i am sending the List of employess to Flex from my Java(Struts) like :(In flex i am using HTTPService)(Employee is a java bean)
    XStream xstream = new XStream();
    EmpDAO dao=new EmpDAO();
    ArrayList<Employee> empList=null;
    empList=(ArrayList<Employee>) dao.getEmployees();
    response.setContentType("text/xml");
    xstream.toXML(empList,response.getWriter());
    This is working fine , but now my requirement is to send java Objects to Flex.
    Is there any way to send Java objects to Flex ??
    Please help me...

    Looks like the properties in your Java class are having
    default scope. Please make sure the getters and setters for the
    properties are public and are following Java beans naming
    conventions. Can you also try creating a DataPoint class in the
    Flex application and map it to the respective Java class. One more
    thing is that, can you change the type of "data" varible in the
    Flex application to ArrayCollection.
    Hope this helps.

  • Java.security.AccessControlException: access denied (java.io.FilePermission

    Hi,
    I have written swing code using applets.The code is::
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class JButtonDemo extends JApplet implements ActionListener{
    JTextField jtf;
    public void init(){
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    ImageIcon ii = new ImageIcon("");
    JButton but = new JButton(ii);
    but.setActionCommand("myButton");
    but.addActionListener(this);
    c.add(but);
    jtf = new JTextField(10);
    c.add(jtf);
    public void actionPerformed(ActionEvent ae){
    jtf.setText(ae.getActionCommand());
    The html is::
    <html>
    <body>
    <applet code="JButtonDemo.class" width="250" height="150">
    </applet
    >
    </body>
    </html>
    Its getting compiled but when I'm trying to run it like..
    appletviewer JButtonDemo.html
    its throwing the following error ..
    java.security.AccessControlException: access denied (java.io.FilePermission read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
    at java.lang.SecurityManager.checkRead(SecurityManager.java:863)
    at sun.awt.SunToolkit.getImageFromHash(SunToolkit.java:472)
    at sun.awt.SunToolkit.getImage(SunToolkit.java:486)
    at javax.swing.ImageIcon.<init>(ImageIcon.java:81)
    at javax.swing.ImageIcon.<init>(ImageIcon.java:107)
    at JButtonDemo.init(JButtonDemo.java:10)
    at sun.applet.AppletPanel.run(AppletPanel.java:353)
    at java.lang.Thread.run(Thread.java:534)
    could anyone pls help me in rectifying this problem...
    Thanks in advance
    Srinivas

    You must have missed something, here is how I got it to work:
    appelt in c:\temp\test.java:import java.awt.Container;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.ImageIcon;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JTextField;
    public class test extends JApplet implements ActionListener {
         JTextField jtf;
         public void init() {
              Container c = getContentPane();
              c.setLayout(new FlowLayout());
              ImageIcon ii = new ImageIcon("c:/test.jpg");
              JButton but = new JButton(ii);
              but.setActionCommand("myButton");
              but.addActionListener(this);
              c.add(but);
              jtf = new JTextField(10);
              c.add(jtf);
         public void actionPerformed(ActionEvent ae) {
              jtf.setText(ae.getActionCommand());
    }html file in c:\temp:<DIV id="lblOutputText">Output comes here</DIV>
    <object
        classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
        codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab"
        >
        <PARAM NAME = CODE VALUE = test >
        <PARAM NAME = ARCHIVE VALUE = sTest.jar >
        <param name = "type" value = "application/x-java-applet">
        <param name = "scriptable" value = "false">
        <comment>
         <embed
                type = "application/x-java-applet" \
                CODE = test \
                ARCHIVE = sTest.jar
             scriptable = false
             pluginspage = "http://java.sun.com/products/plugin/index.html#download">
             <noembed>
                </noembed>
         </embed>
        </comment>
    </object>The batch file creating the signed jar in c:\temp\sign.batdel *.cer
    del *.com
    del *.jar
    del *.class
    javac test.java
    keytool -genkey -keystore harm.com -keyalg rsa -dname "CN=Harm Meijer, OU=Technology, O=org, L=Amsterdam, ST=, C=NL" -alias harm -validity 3600 -keypass password -storepass password
    rem keytool -export -alias harm -file exportPublicKey.cer -keystore harm.com -storepass password
    jar cf0 test.jar test.class
    jarsigner -keystore harm.com -storepass password -keypass password -signedjar sTest.jar test.jar harm
    del *.class
    pause

  • Runtime.getRuntime().exec() and java.io.FilePermission

    Hi all.
    I'm trying to run the following code, in an JSP file, inside an Tomcat installation, with Security Manager activated:
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("arp -n -a");But, when I run the JSP, I receive the following error:
    java.security.AccessControlException: access denied (java.io.FilePermission <> execute)I have the following config. file:
    grant {
      permission java.io.FilePermission "/etc/intranet/intranet.properties", "read";
      permission java.io.FilePermission "/home/projetos/Shofar/conf/ShofarParameters.xml", "read";
      permission java.io.FilePermission "arp", "execute";
      permission java.net.SocketPermission "*:5432",   "accept,connect";
      permission java.lang.RuntimePermission  "selectorProvider";
      permission java.util.PropertyPermission "dns.server",        "read";
      permission java.util.PropertyPermission "dns.search",        "read";
      permission java.net.SocketPermission    "*",                 "resolve";
      permission java.net.SocketPermission    "*:53",              "accept,connect,resolve";
      permission java.io.FilePermission       "/etc/resolv.conf",  "read";
      permission java.net.SocketPermission        "127.0.0.1:465",                                                     "resolve,connect";
      permission java.util.PropertyPermission     "user.name",                                                         "read";
      permission java.io.FilePermission           "/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/javamail.providers",   "read";
      permission java.io.FilePermission           "/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/javamail.address.map", "read";
      permission java.security.SecurityPermission "insertProvider.SunJSSE";
      permission java.util.logging.LoggingPermission "control";
      permission java.util.PropertyPermission "java.awt.headless", "read";
      permission java.io.FilePermission "/tmp/-",                  "read,write,delete";
      permission java.io.FilePermission "/var/lib/tomcat5/temp",   "read";
      permission java.io.FilePermission "/var/lib/tomcat5/temp/-", "read,write,delete";
      permission java.io.FilePermission "/var/lib/tomcat5/work/-", "read,write,delete";
      permission java.util.PropertyPermission "java.io.tmpdir",    "read,write";
      permission java.lang.RuntimePermission "accessClassInPackage.sun.util.calendar";
      permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.RuntimePermission "suppressAccessChecks";
      permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    };As seen, I put the permission java.io.FilePermission "/usr/sbin/arp", "execute"; line, but it don't work.
    What I need to put in the file?

    paulcw is right on the money on that one. You can easily create a bat file to perform that operation for you. However if you are feeling a little adventurous you can always use a Process:
    Process process=Runtime.getRuntime().exec(.....);
    int oneChar;
    InputStream inputStream=process.getInputStream();
    File file=new File("test.txt");
    try{
    file.createNewFile();
    } catch (Exception e){}
    FileOutputStream outputStream=new FileOutputStream(file);
    while ((oneChar=inputStream.read())!=-1){
    outputStream.write(oneChar);

Maybe you are looking for

  • ITunes M4A vs Amazon MP3, ripping in iTunes, cloud services

    Sorry to ask 3 different questions in 1 thread, but they're all kind of related.. 1) I've been struggling for a while to decide which service to use for digital music. Until recently, I always bought physical CDs and ripped them to my computer at 320

  • Insert multiple Rows at a time in Table control.

    I am Doing Dialog Programming, In Table control I have to insert some values,  by clicking on INSERT Button, so now its allowing only single rows to edit.. But as per my requirenments  "I want atleast 10 Rows should be editable,at a time when user cl

  • Connect 4g iPad to component tv adaptor?

    I have an iPad 1 and a 30-pin video out cable with component TV plugs at the other end. This lets me play video on the iPad to the TV. Works great. I just bought an iPad with Retina display, and a lightning-to-30-pin adaptor, expecting that this woul

  • Autosize stops working on Mac

    I have a SWF that loads text from an external outside file, then automatically updates its height using Autosize. However, then I run the swf on a Mac, I only get the first line of text. The tops of the letters on the second line can be seen, but onl

  • How to view materials with selected moving average price

    Dear Gurus, How to view materials with moving average price greater than some selected value?  ie..Is there any report which takes moving average price as input? Thanks in advance, Sastry