• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.security.AccessControlException

 
Mi Chu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an applet issue. It is throwing this error whenever it is trying to access the local documents.


I know adding permissions in the java.plicy file can resolve this issue. But is there any work around this? Since most of the users do not have admin powers on their machines, ading permissions will not work in my case.

Stackoverflow posting:
http://stackoverflow.com/questions/21287048/java-security-accesscontrolexception
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The alternative is to digitally sign the applet: http://www.coderanch.com/how-to/java/HowCanAnAppletReadFilesOnTheLocalFileSystem
 
Mi Chu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried signing the applet also. Even after signing the applet, this error is thrown.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And when you tried to use the signed applet in your browser, did you get a security dialog asking you whether you wanted to trust it?
 
Mi Chu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. I get a mixed-code warning saying it contains both signed and unsigned jars. However, if I say "yes" another error pop-up is shown saying "Error loading configuration file" and the applet fails to initialize. If I say "No", the applet runs fine, but the earlier access denied exception is thrown whenever a local file is accessed.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mithun Chennuru wrote:However, if I say "yes" another error pop-up is shown saying "Error loading configuration file" and the applet fails to initialize.


Then this is the problem you need to fix. I would start by signing all of the jars.
 
Mi Chu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same jar file when build to java 1.4.2 it runs fine with same jars signed and everything else remain same, but when it is build to 1.6.0_35 ..it is throwing this error.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. So you need to look at that error just like you would look at any other error.

Of course if you wanted to ask a question about it, that's what this forum is for.
 
Mi Chu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. My question is I am unable to understand the cause for this error. After reading many articles, which most of them suggested either signing the jar or updating the java.policy file accordingly, which as I said earlier , is not an option for me, I am still unable to get my head around this. Does the version difference cause this difference in behaviour? If yes, what can be done to eliminate this in the newer version of java.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you have nothing but that error message, right? No stack trace? Nothing in the Java console?
 
Mi Chu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message I posted along with my intial post, is from the Stack trace from Java console.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that is the AccessControlException, which is solved by signing the applet. But you mentioned another problem about a config file - that is what you are investigating now, isn't it? And that's the one we don't know anything about. Have you tried signing all jar files, like Paul suggested?
 
Mi Chu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. I didnot try signing all the jar files. But, the same jar file when complied to jre 1.4.2 and signed in the same way, along with same other jar files, is working good. And when it is compiled to jre 1.6.0_35, its not working. Does the newer version of java impose more security on the jar files ?
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mithun Chennuru wrote:Does the newer version of java impose more security on the jar files ?


Yes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!