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 3393866
In Process

The Archive Base Latest Questions

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

I am getting an error when attempting to connect to an RMI service: I

  • 0

I am getting an error when attempting to connect to an RMI service:

I am executing the client code using:

java -Djava.security.manager -Djava.security.policy=path\to\policy.all -jar "path\to\jarfile" "localhost:2020"

The code I am using is:

public class PowerServiceClient
{
    public static void main(String args[]) throws Exception
    {

         System.setSecurityManager
            (new RMISecurityManager());

         // Call registry for PowerService
         PowerService service = (PowerService) Naming.lookup
            ("rmi://localhost:2020/PowerService");

         DataInputStream din = new
             DataInputStream (System.in);

    }
}

The error I am receiving is:

    Exception in thread "main" java.rmi.UnmarshalException: 
    error unmarshalling return; nested exception is:

    java.lang.ClassNotFoundException: rmiservice.PowerService
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Unknown Source)
    at powerclient.PowerServiceClient.main(PowerServiceClient.java:32)
    Caused by: java.lang.ClassNotFoundException: rmiservice.PowerService
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
    at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
    at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    ... 3 more

Does anyone know what the problem is here?

  • 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:06:08+00:00Added an answer on May 18, 2026 at 4:06 am

    The Registry needs access to your remote interface class and its dependencies on its classpath. There are three solutions to that. In order of ease:

    1. Start the Registry inside your server JVM, with LocateRegistry.createRegistry()
    2. Start the rmiregistry process with a -D-Jclasspath= argument
    3. Use the codebase feature.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using DBD::mysql with DBI, I am getting the following error when attempting to connect
Using Java, I get this error when attempting to connect to a mysql database:
I am getting the below error when attempting to connect to a Sybase server
I'm getting an Automation error upon running VBA code in Excel 2007. I'm attempting
I'm using gvim and rails.vim and getting the following error when attempting to run
I'm getting the error when attempting to add to a client-side EntitySet. The following
I keep getting this error when attempting to execute this code, even after placing
I have getting a javascript error when attempting to reference an object in a
I am getting the following error when attempting to build my project in Visual
I am attempting to call a function but the error I am getting is

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.