Solved

Cannot read file though an Applet.

Posted on 2003-10-29
5
240 Views
Last Modified: 2010-04-17
Hello All,
I am in a bit of a spot regarding a small applet I am trying to run. The applet has to read a file and display the contents on a webpage.
The server is a a Solaris 5.8 machine and the client machine is Windows 2000. The browser is IE6.0.
When trying to load the applet the error i get is:-
java.security.AccessControlException: access denied (java.io.FilePermission \tmp\test.mly read)
             at java.security.AccessControlContext.checkPermission(AccessControlContext.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)

Can someone please point me in the right direction reagrding this problem? Its imperative that i get this piece of code working.

Thanks in advance.
Xaverian.
0
Comment
Question by:xaverian_dgp
5 Comments
 
LVL 11

Accepted Solution

by:
bcladd earned 75 total points
ID: 9641223
The Java Security tutorial should be able to help.

http://java.sun.com/docs/books/tutorial/security1.2/

They have an example of running unsigned code that generates an error trace almost identical to yours and then go on to discuss how to sign code and set permissions for it to run. As I recall this tutorial, it is not the clearest writing on the planet but I managed to learn enough to access a local file for read. Don't remember the steps at the moment since I don't use the feature every day.

Hope this helps, -bcl
0
 
LVL 9

Assisted Solution

by:bhagyesht
bhagyesht earned 75 total points
ID: 9648323
is the file that u want to read on the server or client? if its on the server then the problem would be that the file may not have rights for the root. if its on the client side then you need to set up the permissions in clients java.policy file. you can do this even by getting yr applet signed
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 144
program a usb light to turn on when needed 7 63
Getting the Error "User-defined type not defined" in MS Access 2013 16 62
Android development question 2 37
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question