Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Access control exception - access denied

  1. #1
    Junior Member
    Join Date
    Jun 2019
    Posts
    1
    My Mood
    Cheeky
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Access control exception - access denied

    Hi Everyone,

    I have a server and I need to remote control through Java based application.
    In the Java console I see this info:

    Java Plug-in 11.181.2.13 x86
    Using JRE version 1.8.0_181-b13 Java HotSpot(TM) Client VM
    User home directory = C:\Users\ETVKX


    Unfortunately due to errors this is impossible:

    1. At first there is Java Application blocked error (ApplicationBlocked.jpg)
    - adding the presented URL to the Java exception list solves (probably) the problem as I see new errors as described in next point.

    2. Next I receive two different errors:
    a) AccessControlException for FilePermission (accessdenied.png)
    b) AccessControlException for PropertyPermission (mcs.debug.error)

    I added the three below lines in the java.policy file to avoid the errors:
    permission java.net.SocketPermission "10.123.166.20:2000:, "connect";
    permission java.util.PropertyPermission "mcs.debug", "read";
    permission java.io.FilePermission "C:\Users\ETVKX\IBM\10.123.166.20", "read";

    But I still receive the same two errors presented in point 2.

    - What is "mcs.debug" ? Is this Java related?
    - Is the syntax correct that I am using inside java policy file?
    - What additional policies I can use to avoid the errors?

    Any help would be useful for me as I am struggling for more than month now. Thx.

    Regards,
    Robert
    Attached Images Attached Images

  2. The Following User Says Thank You to winicz For This Useful Post:


  3. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Access control exception - access denied

    I haven't worked with Security settings for a while. It would take me a while to setup a test, but I don't have a remote site.

    I remember having to add lines to an Exception List:
    Java icon in Control Panel
    Web Settings tab
    Exception Site List
    add a line like the following to the list:
    file:///D:/JavaDevelopment/Testing/WriteFile/
    A sample .policy file entry:
    grant codeBase "http://127.0.0.1:8080/WriteFile/" {
      permission java.io.FilePermission "<<ALL FILES>>", "write";
    };
     
    grant codeBase "file:/D:/JavaDevelopment/Testing/WriteFile/-" {
      permission java.io.FilePermission "C:\\Temp\\writetest.txtXXXX", "read, write";
      permission java.io.FilePermission "D:\\Testing\\writetest.txt", "read, write";
    };
    If you don't understand my answer, don't ignore it, ask a question.

  4. The Following User Says Thank You to Norm For This Useful Post:


Similar Threads

  1. Access Control Exception
    By TheOrangeCrush in forum Exceptions
    Replies: 4
    Last Post: July 30th, 2021, 07:37 AM
  2. java.sql.SQLException: Access denied
    By FHSerkland in forum JDBC & Databases
    Replies: 2
    Last Post: October 28th, 2017, 02:06 AM
  3. [SOLVED] Access Denied!
    By ajayajayaj in forum What's Wrong With My Code?
    Replies: 54
    Last Post: February 27th, 2013, 07:03 PM
  4. Read Permission Problem -Access Denied
    By ocean1991 in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: December 28th, 2012, 10:38 AM
  5. [SOLVED] Access Denied when extracting zip file.
    By techwiz24 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 18th, 2011, 07:50 PM

Tags for this Thread