CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Java RMI

  1. #1
    Guest

    Java RMI

    I am trying to implement the RMI server on the Remote Host. I do it in the following manner :

    1) Create the Remote Interface
    2) Create a Class that Implements the Remote Interface.
    3) Create the Stub and Skeleton Classes (using rmic...)
    4) Copy the Remote Interface and Stub File to the Client Host
    5) Start Up the remote registry
    6) create and Register the Remote Object : When I try to do this procedure I use the following command at the prompt
    java ServerDir.MyServerImpl
    On execution the exception thrown is
    'java.security.AccessControlException : access denied ( java.net.SocketPermission "111.111.111.111" connect, resolve)
    (Note : the IP address here is only for understanding)
    The Remote object does not get registered. How do I solve this problem ?? Please help.

    Thanks
    Uma


  2. #2
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: Java RMI


    Hi Uma,

    You need to create a policy file. Open notepad , and paste the following lines there..

    ======================
    grant{
    permission java.security.AllPermission;
    };

    ======================

    and save it as policy.txt and put it in your d:\temp directory
    then when u run the server , try like this ..
    d:\jdk1.2.2\bin\java.exe Djava.security.policy=d:\temp\policy.txt YourServerImpl

    If you get any error , Post it.

    Poochi...


  3. #3
    Join Date
    Mar 1999
    Location
    USA
    Posts
    5

    Re: Java RMI

    Hi poochi,

    Your 'policy.txt ' solution worked. However I appended onemore permission to the policy.txt
    permission java.net.SocketPermission "localhost:1024-65535","connect,accept";

    I found that the default policy.txt did not give the required connections to the port.

    Thanks for your help.

    Uma



  4. #4
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: Java RMI


    You are welcome..

    poochi..


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured