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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:16:00+00:00 2026-05-17T03:16:00+00:00

I’ve wrote simple RMI code to learn how it works. While everything works fine

  • 0

I’ve wrote simple RMI code to learn how it works. While everything works fine compiling java code, rmic it and run rmiregistry and run client code from console works fine, but when I choose to “run as Java application” on the client code from Eclipse, it throws MarshallException.

My guess is somewhat Eclipse is compiling with different version according to:

java.rmi.MarshalException

I’ve checked the Eclipse compiler setting and it says 1.6.
(right click on Project Explorer and choose “project facets” then you will see what version the Eclipse is compiling the java files)

My Java is 1.6 so regardless of compiling the code from console and Eclipse should result in 1.6 version complied class files. (javap -verbose | grep -i version brings up version 50 which is equivalent to 1.6 )

Has anyone encountered same issue and has explanation for this?

Likely not necessary but the working code is below.

Client code

package com.masatosan.remote.client;

import java.rmi.Naming;
import java.rmi.RemoteException;

import com.masatosan.remote.server.MyRemoteServer;

public class MyRemoteClient  {

    public static void main(String[] args) {
        new MyRemoteClient().go();
    }

    public void go() {
        try {
            MyRemoteServer service = (MyRemoteServer) Naming.lookup("rmi://127.0.0.1/MyFirstRemoteService");
            String s = service.sayHello();

            System.out.println(s);
        }
        catch(Exception ex) {
            ex.printStackTrace();
        }
    }
}

Server code

package com.masatosan.remote.server;

import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class MyRemoteServerImp extends UnicastRemoteObject implements MyRemoteServer {

    public static void main(String[] args) {
        try {
            MyRemoteServer service = new MyRemoteServerImp();
            Naming.rebind("MyFirstRemoteService", service);
        }
        catch(Exception ex) {
            ex.printStackTrace();
        }
    }

    public MyRemoteServerImp() throws RemoteException {}

    @Override
    public String sayHello() throws RemoteException {
        return "Hi I'm server!";
    }
}//

Server code interface for stub

package com.masatosan.remote.server;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface MyRemoteServer extends Remote {

    public String sayHello() throws RemoteException;
}
  • 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-17T03:16:00+00:00Added an answer on May 17, 2026 at 3:16 am

    The version in question is not the version of the JRE but the version of the classes being called. This means your client is calling a different set of jars in eclipse. In general if eclipse and the console are giving different results it’s almost always a classpath issue.

    Check the ‘Java Build Path’ section of your project and all projects that are related to make sure everything matches up. Keep an eye out for the jar that has ‘com.masatosan.remote.server.MyRemoteServer’, I believe that is the one that is having the version issue. The jar that eclipse is pointing to might be different and/or stale. Here are some places to check in the build path section of your project

    1)Make sure you are using the ‘projects’ tab correctly.

    2)Check to make sure all the jars on the ‘libraries’ tab are the same as when compiled on the console

    3)Make sure that that none of the jars that should be included by the ‘projects’ tab are in the ‘libraries’ tab. I have seen many people tare their hair out because eclipse was using jars that were only updated if they compiled from the command line.

    4)Play around with the ‘Order and Export’ tab. If something is above something else it gets loaded first. The version that is loaded first is the version that is used. If both your command line app and eclipse project have the same jars but include them in a different order you can have these issues.

    5)Some jars can be installed directly in to the JRE by including them in the JREs directory. This is HIGHLY unlikely but you can check the JRE eclipse is using and make sure it’s the same one as the console.

    Good luck, classpath problems are very tricky.

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

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.