Solved

Cannot read file though an Applet.

Posted on 2003-10-29
5
221 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
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.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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 …

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now