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

  • Home
  • SEARCH
  • 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 3398836
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:41:52+00:00 2026-05-18T04:41:52+00:00

I am trying to get a rmi connection going. I have ran into many

  • 0

I am trying to get a rmi connection going. I have ran into many security issues but have been unable to find a way past all this. I execute my jar file with:

java -Djava.security.policy=java.security.AllPermission -jar "myjarfile"

The code I have been using to create this is:

public class server
{
    public static void main(String args[])throws Exception
    {
    if (System.getSecurityManager() == null)
        System.setSecurityManager ( new RMISecurityManager() {
        public void checkConnect (String host, int port) {}
        public void checkConnect (String host, int port, Object context) {}
        });

    try
    {
        sampleserverimpl server = new sampleserverimpl();
        System.out.println("SERVER IS WAITING");
        LocateRegistry.createRegistry(2020);

        //Runtime.getRuntime().exec("rmiregistry 2020");
        Naming.rebind("//localhost:2020/SERVER", server);

    }
    catch(Exception e)
    {
        System.out.println(e);
    }
}
};

The error trace I am receiving is:

Exception in thread "RMI TCP Connection(idle)" java.security.AccessControlExcept
ion: access denied (java.net.SocketPermission 127.0.0.1:31199 accept,resolve)jav
a.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:

    java.io.EOFException

I have tried different ways to get around this, can anyone see the issue here?

Thanks

  • 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-05-18T04:41:53+00:00Added an answer on May 18, 2026 at 4:41 am

    -Djava.security.policy accepts a URL which points to a policy file which in turn contains the permissions. So you should have: -Djava.security.policy=/some/path/my.policy as the JVM argument where the my.policy file contains:

    grant {
      permission java.security.AllPermission;
    };
    

    Also, in order to avoid the NULL check present in your code and the manual creation of a SecurityManager, you can request a SecurityManager be automatically installed for your application by passing the JVM switch: -Djava.security.manager.

    Your final JVM invocation should look like:

    java -Djava.security.manager -Djava.security.policy=/some/path/my.policy
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get an RMI activatable server to work - but no
Have been pulling out my hair trying to find out why my sessions are
Trying to get an understanding on how the RMI is working (I have a
Hi am trying get GPS using network provider and GPS provider. but am getting
I'm trying get only the Saturdays and Sundays between two dates, but I don't
I am trying get the html within .event_recur. $(.entry).each(function(){ alert($(this).find(.event_recur).html()); }); <div class=entry> <p
I'm trying to use SealedObjects to send data over an RMI connection target is
I am trying to do some testing using RMI. I have a .jar file
I am trying to run a simple rmi application. However I've run into unexplainable
I am trying get my first simple project in rails to run. I have

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.