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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:45:58+00:00 2026-05-23T09:45:58+00:00

I am having a problem setting up a simple RMI server, and was wondering

  • 0

I am having a problem setting up a simple RMI server, and was wondering if someone can point me in the right direction.

I have a simple class, Server, that should export an simple interface. Currently when I try and run the server class, I get the following exception:

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
java.lang.ClassNotFoundException: prototype.ISimpleService

I have already made sure that the rmi registry is running, by running the “start rmiregistry” command, and I am running the service with the following argument

-Djava.rmi.server.codebase=file:C:/Users/John/Documents/NetBeansProjects/Prototype/build/classes

The path in the argument above points to the top level folder of my class hierarchy, so:

/classes

/prototype

->ISimpleService.class

->SimpleServiceImpl.class

->IServer.class

Here is my server code:

public class Server
{
    private static ISimpleService service;

    public static void main(String[] args)
    {
        service = new SimpleServiceImpl();

        try
        {
            ISimpleService stub = (ISimpleService) UnicastRemoteObject.exportObject(service, 0);

            Registry registry = LocateRegistry.getRegistry();

            registry.rebind("SimpleService", stub);

            System.out.println("Simple Service bound");
        } 
        catch (Exception ex)
        {
            System.out.println("Exception binding the simple service");
            ex.printStackTrace();
        }
    }
}

I have looked at the Java RMI trail, and adapted my simple example to follow that, although I am not using security/permissions that I shouldn’t need as I have gotten an RMI example working before without that stuff…

So I believe I have to missing something simple(no pun intended), to make this work, but I cant see anything at the moment.

Do anyone have an ideas?

Here is the full stack trace:

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: prototype.ISimpleService
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:396)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask    (ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer    (StreamRemoteCall.java:255)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at prototype.Server.main(Server.java:35)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: prototype.ISimpleService
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:386)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask    (ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: prototype.ISimpleService
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:711)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:655)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:592)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
    at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1530)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1492)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    ... 12 more
  • 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-23T09:45:59+00:00Added an answer on May 23, 2026 at 9:45 am

    I have solved this issue… Took me alittle longer than I expected though 🙁

    Turns out when you use a codebase argument like I had done, you should place a trailing “/” at the end, if you are pointing to a directory. Once I added that in, my server successfully binds.

    For a resource on this p see http://download.oracle.com/javase/1.4.2/docs/guide/rmi/codebase.html#section6

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

Sidebar

Related Questions

I'm having a very simple problem, which can be solved fairly simple but for
I'm having a real problem with the WCF web api. I have a simple
I'm wondering if this is something somewhat simple, but I'm having a problem ONLY
I have created a simple JSF image browsing app, and I'm having a problem
i'm having a small problem with correctly setting my postfix server as to not
I'm having a problem setting a cookie and doing a 302 redirect In chrome
I am having a problem setting up the following in Visual Studio 2008: a
I am having a problem setting the background of UITableView to a UIImageView (see
hi forum member I am having one problem with setting the radiofield in the
I am having a problem where a cookie I am setting is being lost

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.