This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "" Watch "" New topic

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492

I just uploaded my JApplet in my webserver. And accessed using IE browser, I have a text file in the server and while the applet is trying to read am getting below exception. After that I change the file permission to 777(all read write and execute) but still am getting the same exception. Please assist me. access denied ( al3.txt read)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
at NewPoints.readAndLoad(
at NewPoints.init(
at Source)
at Source)
at java.lang.StringBuffer.<init>(Unknown Source)
at NewPoints.NextQ(
at NewPoints.init(
at Source)
at Source)
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41056
If the file is on the server, then you can't use FileReader or FileInputStream to read it. Any of those classes will access the client-side file system, which is off limits to applets.

See the "Hello Server File" example in for how applets can read files on the server.

Ping & DNS - my free Android networking tools app
I agree. Here's the link:
Similar Threads
file reading in applet
Getting error while displaying tif image in applet through browser.
Applet File Permission !!
AccessControlException question
Exception in runnig applet