Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Access Permission

Reply
Thread Tools

Access Permission

 
 
Ken Kast
Guest
Posts: n/a
 
      06-08-2004
I've written a small applet that reads and parses various XML files on the
server and creates Documents that are to be manipulated by javascript on the
client. It uses standard javax.xml.* packages out of 1.4.2_04. The applet
and XML files are in a subfolder of the directory where the web page is.
The applet works OK in an applet viewer in the IDE, but when I try to run it
in the browser I get the following error message in the console:

Exception while creating stream: access denied (java.io.FilePermission
C:\Documents and Settings\Ken\My Documents\My
Webs\kenkast\NewsReader\applets\default.opml read)

Here's the code that causes the exception:
public Document XDoc(URL url) {
Document doc = null;
Utilities.msg("XDoc URL: " + url);
try {
Utilities.msg("Try to get a stream");
InputStream in = url.openStream(); // Error occurs here
Utilities.msg("Got a stream");
BufferedInputStream bis = new BufferedInputStream(in);

Here are the two messages before the exception:
XDoc URL:
file:/C:/Documents%20and%20Settings/Ken/My%20Documents/My20Webs/kenkast/NewsReader/applets/default.opml
Try to get a stream

(NewsReader is where the html is.)

Can someone tell me why this doesn't work?

Thanks.




 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      06-08-2004
On Tue, 08 Jun 2004 03:25:06 GMT, Ken Kast wrote:

> I've written a small applet that..

...
> Exception while creating stream: access denied (java.io.FilePermission

...
> Can someone tell me why this doesn't work?


An applet must be signed to do use files..
<http://www.physci.org/codes/javafaq.jsp#jws>
<http://www.physci.org/codes/javafaq.jsp#jar>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
 
Ken K
Guest
Posts: n/a
 
      06-08-2004
Andrew Thompson <(E-Mail Removed)> wrote in message news:<3ez8gxz9g4bm.58zptpt6ba5p$(E-Mail Removed)>.. .
> On Tue, 08 Jun 2004 03:25:06 GMT, Ken Kast wrote:
>
> > I've written a small applet that..

> ..
> > Exception while creating stream: access denied (java.io.FilePermission

> ..
> > Can someone tell me why this doesn't work?

>
> An applet must be signed to do use files..
> <http://www.physci.org/codes/javafaq.jsp#jws>
> <http://www.physci.org/codes/javafaq.jsp#jar>


I am confused. I thought browser security policy let an unsigned
applet access its directory and any subdirectories on the server. In
this case the "server" is my hard drive. I've tried my applet and
html on my site (kenkast.com) with exactly the same effect.

Ken
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      06-08-2004
On 8 Jun 2004 09:42:01 -0700, Ken K wrote:

> Andrew Thompson <(E-Mail Removed)> wrote in message news:<3ez8gxz9g4bm.58zptpt6ba5p$(E-Mail Removed)>.. .
>> On Tue, 08 Jun 2004 03:25:06 GMT, Ken Kast wrote:
>>
>>> I've written a small applet that..

>> ..
>>> Exception while creating stream: access denied (java.io.FilePermission

>> ..
>>> Can someone tell me why this doesn't work?

>>
>> An applet must be signed to do use files..
>> <http://www.physci.org/codes/javafaq.jsp#jws>
>> <http://www.physci.org/codes/javafaq.jsp#jar>

>
> I am confused. I thought browser security policy let an unsigned
> applet access its directory and any subdirectories on the server.


Yes. You are confused.

Do you think that you running the policytool
on your IE could change what an applet coming
from my site would allow you to do on my server?

I went hunting at Sun for PolicyTool and found this first hit..
<http://java.sun.com/developer/onlineTraining/Security/Fundamentals/magercises/Policytool/>
Note the use of the word 'local' in first sentence..

[ Search facilities are wonderful things, no? ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed: The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {555F3418-D99E-4E51-800A-6E89CFD8B1D7} to the user NT AUTHORITY\LOCAL SERVICE SID (S-1-5-19). Skybuck Flying Windows 64bit 1 06-29-2009 06:17 PM
PERL windows : "Windows cannot access the specified device, path orfile. You may not have the appropriate permission to access the item." guru Perl Misc 4 02-18-2009 04:46 PM
Unable to "access" PC on Home Network : No Access Permission GoldHawk Wireless Networking 2 04-19-2008 09:48 PM
permission to access computer on network =?Utf-8?B?TWFyaWU=?= Wireless Networking 3 05-11-2005 12:32 PM
ASP.NET doesn't have permission to access resource Brent Bigler ASP .Net 4 12-20-2003 02:55 AM



Advertisments