Solved

Cannot read file though an Applet.

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…
Simple Linear Regression

632 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