Solved

Cannot read file though an Applet.

Posted on 2003-10-29
5
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

762 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