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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:35:17+00:00 2026-06-13T13:35:17+00:00

i m beginning Java RMI with a simple example. the actual example works fine

  • 0

i m beginning Java RMI with a simple example. the actual example works fine (from roseindia) but i have extended it a little and i get error. The file for remote interface is as follows:-

import java.rmi.*;

public interface RemoteInterface extends Remote
{
 public int add(int x,int y)throws Exception;  //original line
 public int sub(int x, int y)throws Exception; //added later by me
}

Now the code snippet for the Client file that generates error is :-

b.addActionListener(new ActionListener() {  // b is a JButton
public void actionPerformed(ActionEvent evt) {
int a = Integer.parseInt(t1.getText());     //t1 and t2 are TextField
int b = Integer.parseInt(t2.getText());
try {
int r  = s.add(a,b); 

 rs.setText("Sum of two no.s=" + r);       //rs is a Label
} catch (Exception epx) {
}
}
});

it works fine. but when i add the following for another button

  b2.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt1) {
  int a1 = Integer.parseInt(t1.getText());
  int b2 = Integer.parseInt(t2.getText());
  try {
        int r2 = s.sub(a1, b2);
  rs.setText("Subtraction of two no.s =" + r2);
    } catch (Exception epx) {
     }
   }
    });

i get following error

C:\Program Files\Java\jdk1.6.0_14\bin>java Client
Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError: ServerImpl
ements_Stub.sub(II)I
    at Client$2.actionPerformed(Client.java:65)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:19
95)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
a:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242
)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574
   )
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)

    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
  java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
  ad.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Just a hint of problem would be too helpful. thanks in advance.

  • 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-13T13:35:19+00:00Added an answer on June 13, 2026 at 1:35 pm

    You’ve changed something without recompiling all its dependencies: in this case you haven’t regenerated the stub. Recompile everything and retest.

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

Sidebar

Related Questions

I'm studying Java basics from the beginning. But there is still some theoretical basis.
This is back to the beginning of Java 101, but I have this code
I'm new to Java but not to programming. I'm reading the book Beginning Android
I read Beginning Java EE 6 platform with GlassFish 3 from Antonio Goncalves. In
How do I remove white-space from the beginning of a string in Java without
I am beginning Java programming, and I have written a program which tests how
I'm OK with the java for this beginning app I'm attempting. But the XML
I'm working on my first real project with Java. I'm beginning to get comfortable
In the beginning of my Java code I have: import java.awt.BorderLayout; import java.awt.Container; import
I'm just beginning to learn Java and I have been very frustrated about learning

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.