Solved

Cannot read file though an Applet.

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Advice in Xamarin 21 121
Why is enum singleton a better approach than static factory 3 67
Adding a countdown to HTA 12 116
File attachment in the SQL Database from application 10 48
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

752 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