Results 1 to 10 of 10
  1. #1
    krati is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default Java RMI .policy file

    Hi everyone I wanted to ask how can I make a security.policy file in Java RMI application
    please give me the steps required to make a .policy file with a notepad or any other windows text editor

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    See: Default Policy Implementation and Policy File Syntax

    Where the main points to enable the use is with the -D for specifing the java.security.policy file.

    and their sample polic y files help to show how you could do grants.

  3. #3
    krati is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default rmi policy files

    Thank you sir but I want the steps to create the .policy file with a text editor and then use it to run the rmi client.Have you made any .policy files....If yes then please tell me.Please help me .

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,728
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by krati View Post
    Thank you sir but I want the steps to create the .policy file with a text editor and then use it to run the rmi client.Have you made any .policy files....If yes then please tell me.Please help me .
    Did you actually bother to read the link supplied by Travishein? It is just a few pages and does exactly what you asked for: give a step by step detailed explanation of the details of policy files; it doesn't explain the gory details of a text editor though; you are supposed to know these things.

    kind regards,

    Jos

  5. #5
    krati is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default reply

    Yes sir I have gone read the material at the link specified by travishein but still I am not sure of how should I do it.I am giving here the steps that I took ,please tell me what is going wrong:
    1.I wrote in a Notepad file the following:
    grant {
    // Allow the client to connect to any port above 1024
    permission java.net.SocketPermission “*:1024-”, “connect”;
    };
    2.I saved the file as security.policy in the project folder
    3.At time of running I opened a command window and wrote :
    c:>java -Djava.security.policy=security.policy rmiClientfilename
    but I got many exceptions like access denied etc. So I am not sure how can I generate the .policy files?Are they automatically generated by running the .java file which is a subclass of Policy class of java.security package.

    I didnt intend to offend Travishein but I am really not able to do this even after reading the link which he specified and so I am feeling very helppless.

    Please guide me,
    Thank you

  6. #6
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    Hmm, don't you also need to have -Djava.security.manager

    Java Code:
    java -Djava.security.manager -Djava.security.policy=security.policy rmiClientfilename

  7. #7
    krati is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default reply

    thank you sir it worked.

  8. #8
    guddy is offline Member
    Join Date
    Apr 2014
    Posts
    2
    Rep Power
    0

    Default

    Hi sir i too hv same problem plz tel me how can I make security file in java RMI application
    In step by step plz tel me

    Hi everyone I wanted to ask how can I make a security.policy file
    in Java RMI application
    please give me the steps required to make a .policy file with a notepad or any other windows text editor

    Hi everyone I wanted to ask how can I make a security.policy file
    in Java RMI application
    please give me the steps required to make a .policy file with a notepad or any other windows text editor.... Please help me and how to compile and run please help me I am waiting for your rep
    Last edited by Norm; 04-25-2014 at 06:45 PM.

  9. #9
    guddy is offline Member
    Join Date
    Apr 2014
    Posts
    2
    Rep Power
    0

    Default Re: reply

    N hw to run in command prompt plz wit each step..

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,789
    Rep Power
    25

    Default Re: Java RMI .policy file

    N hw??? Please use English when posting?

    4 year old thread closed.

    Start a new thread for your question.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Applet+thread+java policy
    By shiva_l in forum Java Applets
    Replies: 0
    Last Post: 12-29-2008, 11:20 AM
  2. Replies: 1
    Last Post: 10-16-2008, 10:56 PM
  3. Djava.security.policy=applet.policy
    By willemjav in forum Java Applets
    Replies: 1
    Last Post: 03-09-2008, 02:57 AM
  4. Djava.security.policy=applet.policy
    By willemjav in forum NetBeans
    Replies: 0
    Last Post: 03-09-2008, 02:09 AM
  5. java.policy
    By cubidoo in forum New To Java
    Replies: 0
    Last Post: 12-01-2007, 10:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •