Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7935197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:51:01+00:00 2026-06-03T21:51:01+00:00

i am having a problem creating RMIserver class because i keep getting this error

  • 0

i am having a problem creating RMIserver class because i keep getting this error : access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)

now i read on google something about cerating new policy file but i dont really understand how to do so, can please someone help me ?

here is my server code :

import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.registry.*; 
import java.security.Permission;
import java.security.Security;

public class RmiServer extends UnicastRemoteObject 
    implements RmiServerIntf 
    {
    public static final String MESSAGE = "Hello world";

    public RmiServer() throws RemoteException
    {
    }

    public String getMessage()
    {
        return MESSAGE;
    }


    public static void main(String args[])
    {
        System.out.println("RMI server started");

        // Create and install a security manager
        if (System.getSecurityManager() == null)
        {
            System.setSecurityManager(new RMISecurityManager());
            System.out.println("Security manager installed.");
        }
        else
        {
            System.out.println("Security manager already exists.");
        }

        try
        { //special exception handler for registry creation
            LocateRegistry.createRegistry(1099); 
            System.out.println("java RMI registry created.");
        } 
        catch (RemoteException e)
        {
            //do nothing, error means registry already exists
            System.out.println("java RMI registry already exists.");
        }

        try 
        {
            //Instantiate RmiServer
            RmiServer obj = new RmiServer();


            // Bind this object instance to the name "RmiServer"
            Naming.rebind("//localhost/RmiServer", obj);

            System.out.println("PeerServer bound in registry");
        } 
        catch (Exception e) 
        {
            System.err.println("RMI server exception:" + e);
            e.printStackTrace();
        }
    }

}    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:51:02+00:00Added an answer on June 3, 2026 at 9:51 pm

    You are using a SecurityManager (why?) but your security policy doesn’t grant you the permission specified in the exception. You don’t need a SecurityManager at all unless you are planning to use the RMI codebase feature: are you?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem with creating my styles for a custom wpf class. This
I'm trying to create this JSON string but having problem creating it. I'm getting
Im having this weird problem with creating Json dynamically.... for some reason this doesnt
I am new to OOP having this code and am having a problem creating
I'm having a problem with a generic class I'm creating in Scala. I have
I've been having a problem creating a checklist in the style of the TouchCells
i am having problem in creating a video player in flash via as3, the
I'm having a problem creating a trigger on a database for a project I've
I am having a problem with creating a navigation controller after on the other
Having a bit of a problem creating an instance of an object. Bear in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.