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);

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.

  • Completed Project Doesn't work When Deployed FilePermission Error

    Hello all,
    I have been slaving away over an applet for the past several weeks, and I have finally gotten it finished. When I tried to upload it to MY web server, it suddenly stopped working. The applet itself reads files from the directory in which it is run, and apparently even when these files are given a 777 permission, the applet still can't read them. I'm baffled as to what's going on.
    For the HTML code, I am using
    <applet code="tempGraph.class" codebase="http://www.michaeljaylissner.com/archive/java/" height=400 width=750>Java Applet</applet>
    The page hosting the applet is here: www.michaeljaylissner.com/pct-temperatures.
    The code for the applet and the data files themselves are here:www.michaeljaylissner.com/archive/java/.
    Any help would be greatly appreciated. I was so happy to have the coding done, I just assumed that putting the thing in a website would be easy. WRONG!!
    The error the java console is giving me is: Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.io.FilePermission iButtonResults-MattChurch-2.csv read)
    I can't imagine how to fix this problem!

    Hmm, are you doing something like this to load the file?
            timingProps = new Properties();
            InputStream pis = this.getClass().getResourceAsStream("/timing.properties");
            if (pis != null) {
                try {
                    timingProps.load(pis);
                catch (IOException x) {
                    CCLogger.getLogger().log(Level.SEVERE, "Unable to load the timing.properties configuration file! " + x.getMessage());
                finally {
                    try {
                        pis.close();
                    catch (IOException x) {/* do nothing */}
                CCLogger.getLogger().log(Level.INFO, "Timing properties have been loaded.");
            } else {
                CCLogger.getLogger().log(Level.SEVERE, "Unable to load the timing.properties configuration file!");
            }I think you are right that you shouldn't have to sign the applet if the file is coming from the same web server the applet is deployed on.

  • 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

  • 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

  • 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.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);

  • Java Web Start Error in through codebase url with SSL

    I have created one Java web-start plugin application in swing which is launched from PHP site at browser plugin.
    All things were working fine, but when we implemented SSL in our site it stopped working. And when we try to start the application from browser it thorws error like:
    Unable to launch Application.
    In Java console it puts following log:
    JNLP Ref (...): NULL !
    #### Java Web Start Error:
    #### null
    Following is my JNLP file:
    <jnlp spec="1.0+" codebase="https://<<server_domain>>/MyPlugin/">
      <information>
        <title>Test Plugin</title>
        <vendor>The Java(tm) Tutorial</vendor>
        <homepage href="null"/>
        <description>Test Plugin</description>
        <description kind="short">Test Plugin</description>
        <offline-allowed/>
      </information>
      <security>
        <all-permissions/>
      </security>
      <update check="timeout" policy="always"/>
      <resources>
        <java version="1.7+"/>
        <jar href="http://<<server_domain>>/MyPluginJar.jar" download="eager" main="false"/>
      </resources>
      <application-desc>
        <argument>test</argument>
        <argument>test</argument>
        <argument>test</argument>
        <argument>test</argument>
        <argument>test</argument>
      </application-desc>
    </jnlp>
    The issue started only after implementation of SSL in our site. Please provide any solution for this. Many thanks in advance.
    P.S. My Jar file is signed by third party authorized certificate.

    Have you tried using Rosetta?

  • Report Script returns no data and "java.io.FileNotFoundException" error

    When attempting to write to a new file (Eg: C:\TEST.txt), Report Script returns no data and "java.io.FileNotFoundException" error occurs.
    This error occurs only in Essbase 9.3.1.3 release, however it works fine in release 9.3.1.0.
    After running the report the script, it pops up the follwing message:
    "java.io.FileNotFoundException: ..\temp\eas17109.tmp (The system cannot find the file specified): C:\TEST.txt"
    When checked the TEST.txt, it was empty.

    Sorry folks, I just found out the reason. Its because there was no data in the combination what I was extracting.
    but is this the right error message for that? It should have atleast create a blank file right?

  • Java.sql.SQLException: Error while trying to retrieve text for error ORA-24

    Hi All,
    Am having serious problem with ORA-24327 and the behavior is very very unpredictable. I have couple of environment where the same error comes in different context. The recent one was surprising. I have describe bellow the environment configuration and the stack trace. The error which surprised me was when I use type � 3 driver while starting weblogic I get ORA �24327 but when I use Type �4 it starts properly. If you could kindly provide solution it would be great help. I would also appreciate if u can provide information which driver to use where performance is the major concern. I would also appreciate if u could provide feed-back from the industry about booth the driver. Apart from that I have couple have environment where it occurs when 10/12 user access simultaneously. All the open connection is closed in program properly still am getting the error.
    Thanks in anticipation.
    Cheers,
    Tapas
    Environment
    OS - SunOS 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-Enterprise
    JDK - Solaris VM (build Solaris_JDK_1.2.2_07, native threads, sunwjit)
    Weblogic - 5.1.0 Service Pack 9 04/05/2001 14:59:53 #105983
    Oracle � 8.1.6
    Delaying 10 seconds before making a beuatpool pool connection.
    Pool 1 (Type �3 )
    weblogic.jdbc.connectionPool.beuatpool=\
    url=jdbc:weblogic:oracle,\
    driver=weblogic.jdbc.oci.Driver,\
    loginDelaySecs=10,\
    initialCapacity=10,\
    maxCapacity=20,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=10,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=xxx;password=xxx;server=xxxx
    Pool 2(Type �4)
    weblogic.jdbc.connectionPool.thinPool=\
    url=jdbc:oracle:thin:@xxx:1521:xxx,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=15,\
    testTable=dual,\
    props=user=xxx;password=xxx;server=xxx:1521:xxx
    allow=everyone
    ---------- LOGIN ERROR CODE: 24327
    java.sql.SQLException: Error while trying to retrieve text for error ORA-24327 �
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at weblogic.db.oci.OciConnection.getLDAException(OciConnection.java:143)
    at weblogic.jdbcbase.oci.Driver.connect(Driver.java:157)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:149)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:109)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    ---------- LOGIN ERROR CODE: 24327
    ---------- LOGIN ERROR CODE: 24327
    Fri Aug 31 00:57:22 GMT-05:00 2001:<I> <JDBC Pool> Sleeping in createResource()
    Fri Aug 31 00:57:23 GMT-05:00 2001:<E> <JDBC Pool> Failed to create connection p
    ool "beuatpool"
    weblogic.common.ResourceException: weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: Error while trying to retrieve text for error ORA-24327 -
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at weblogic.db.oci.OciConnection.getLDAException(OciConnection.java:143)
    at weblogic.jdbcbase.oci.Driver.connect(Driver.java:157)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:172)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:109)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at weblogic.common.ResourceException.<init>(ResourceException.java:18)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:182)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:109)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at weblogic.common.ResourceException.<init>(ResourceException.java:18)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:125)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)

    Hi,
    I guess you can try some of these:
    - Make sure you're not missing an entry inside your tnsnames.ora file. Thin driver does not require the information inside that file, as opposed to Weblogic's OCI driver. If you are able to connect to the DB using a thin driver, then the problem is most probably (WL)driver-related.
    - Make sure you've properly configured the DB user / password inside your weblogic.properties (config.xml if WL6+).
    - Make sure you're able to access all drivers and classes required (PATH, CLASSPATH, etc...)
    - Make sure the OCI driver version you are using is fully compatible with the Oracle (server) version you are pointing to.
    - Try to access the DB user through some other client (for instance, SQLPlus*).
    Hope this is of some help,
    Freddy.

  • Ever since I downloaded FF's v6, everytime I go to YouTube and open a video, I get an error message that says: "[Java Script Application] Error: Div is null" How do I fix this problem?

    If I go to YouTube, no matter what video I click on to watch, the error message "[Java Script Application] Error: Div is null" pops up. It started happening right after I updated to FF v6. I also have installed the latest version of Java. I submitted this question a few weeks ago, but never received a reply.
    Thanks for any help you can provide to fix this.
    Scott Cromwell
    [email protected]

    hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • Java.sql.SQLException: Error in allocating a connection. Cause: No Password

    I'm deploying an EJB Module with a CMP in SJAS from SJSE.
    I get the following exception "java.sql.SQLException: Error in allocating a connection. Cause: No PasswordCredential found" the first time a CMP tries to connect to the MS SQL Server database.
    I can connect through the Admin console (PING works fine) but this error hapens in runtime.
    The datasource classname i'm using is "com.sun.sql.jdbcx.sqlserver.SQLServerDataSource" which is suggested by the SJSE.
    Any help will be welcome...
    Nelson Marques

    If you are using Netbeans, then this link might help:
    http://forum.java.sun.com/thread.jspa?forumID=136&threadID=598423
    Otherwise, have you try this ?
    Verify your sun-ejb-jar.xml does not use default-resource-princinpal element:
    <res-ref-name>jdbc/pdisasdb</res-ref-name>
    <jndi-name>jdbc/pdisasdb</jndi-name>
    <default-resource-principal>
    <name>myname</name>
    <password>geheim</password>
    </default-resource-principal>
    </resource-ref>

Maybe you are looking for

  • Remove or Hiding Marketing Documents from SAP Business One.

    Hi Everyone, Is there any way by which a marketing document in SAP Business One can be deleted or be hidden. For example in a Sales A/R module the the client does not want to use or also view the AR downpayment request or AR down payment invoice as i

  • [Solved] Set Screen Resolution in Openbox

    Is there a utility to set the screen resolution in Openbox? Last edited by Wintervenom (2008-09-26 07:43:03)

  • Sed help

    Hi I am trying to get rid of " " in a txt file with sed although can't get it to work...(i am not very experinced with sed) anyway, I have a txt file whic looks like this: "hi" "there" "we" "like" "sed and I wanna separate everythng so that i can get

  • Photoshop Quits unexpectedly is very annoying.

    I loose all my hard work when this happens, this is very upsetting and a HUGE waste of time. Photoshop should have a feature that recovers your files if it quits unexpectedly. Similar to Adobe Muse. And fix those bugs that quits Photoshop in the 1st

  • Capitalization in Infopath Expression Box

    Hello, I have a first and last name in a single expression box and wanted the first and last name to capitalize if typed in. I have already accomplished this using:  concat(substring(translate(Recipient Name, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJ