Abstract Method Error exception
843833Jul 12 2004 — edited Jul 28 2004java.lang.AbstractMethodError: bank._BankMgr_Stub.updateBalance(ID)V
--------------------------------------------------------------------------------
Hi,
I am using sun one studio IDE and Sun one app server.
While I was running test client here is what I am getting:
java.lang.AbstractMethodError: bank._BankMgr_Stub.updateBalance(ID)V
at bank.BankMgrTest.main(BankMgrTest.java:31)
Exception in thread "main"
I am really frastruated and I have no idea why is it throwing an abstract method exception when I am not invoking any abstract method. I would really appreciate any help on this.
Can someone can help me please?
I have no clue as why is it throwing this exception.
****************************Test Client:
/*
* BankMgrTest.java
*
*/
package bank;
import javax.ejb.*;
import java.rmi.*;
import javax.rmi.*;
import javax.naming.*;
import java.util.*;
public class BankMgrTest {
/** Creates a new instance of BankMgrTest */
public BankMgrTest() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Hashtable props = new Hashtable();
props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
props.put("java.naming.provider.url", "iiop://localhost:3843");
try {
Context c = new InitialContext(props);
Object o = c.lookup("ejb/BankMgr");
BankMgrHome bankMgrHome = (BankMgrHome)PortableRemoteObject.narrow(o, BankMgrHome.class);
BankMgr bankMgr = bankMgrHome.create();
System.out.println("problem starts from here:");
CustomerData cd = bankMgr.getCustomerData(1);
System.out.println("cd: "+cd);
bankMgr.remove();
}
catch (javax.naming.NamingException e) {System.out.println("e: "+e);}
catch (javax.ejb.CreateException e) {System.out.println("e: "+e);}
catch (javax.ejb.RemoveException e) {System.out.println("e: "+e);}
catch (java.rmi.RemoteException e) {System.out.println("e: "+e);}
catch (bank.BankException e) {System.out.println("e: "+e);}
}
}
************************Home Interface:
package bank;
import javax.ejb.*;
import java.rmi.*;
public interface BankMgrHome extends EJBHome {
public BankMgr create () throws CreateException, RemoteException;
}
*****************************Remote Interface:
package bank;
import javax.ejb.*;
import java.rmi.*;
public interface BankMgr extends EJBObject {
public CustomerData getCustomerData (int id)
throws BankException, RemoteException;
}
*****************************************CustomerData Class:
/*
* CustomerData.java
*
* Created on July 8, 2004, 3:22 PM
*/
package bank;
/**
*
* @author sjoy
*/
public class CustomerData implements java.io.Serializable {
/** Holds value of property userid. */
private int userid;
/** Holds value of property firstname. */
private String firstname;
/** Holds value of property lastname. */
private String lastname;
/** Holds value of property address. */
private String address;
/** Holds value of property phone. */
private String phone;
/** Holds value of property balance. */
private double balance;
/** Creates a new instance of CustomerData */
public CustomerData() {
}
/** Getter for property userid.
* @return Value of property userid.
*
*/
/** Creates a new instance of CustomerData */
public CustomerData(int userid, String firstname, String lastname,
String address, String phone, double balance) {
this.userid = userid;
this.firstname = firstname;
this.lastname = lastname;
this.address = address;
this.phone = phone;
this.balance = balance;
}
public String toString() {
StringBuffer s = new StringBuffer();
s.append ("userid = "); s.append (userid);
s.append (", firstname = "); s.append (firstname);
s.append (", lastname = "); s.append (lastname);
s.append (", address = "); s.append (address);
s.append (", phone = "); s.append (phone);
s.append (", balance = "); s.append (balance);
return new String (s);
}
public int getUserid() {
return this.userid;
}
/** Getter for property firstname.
* @return Value of property firstname.
*
*/
public String getFirstname() {
return this.firstname;
}
/** Getter for property lastname.
* @return Value of property lastname.
*
*/
public String getLastname() {
return this.lastname;
}
/** Getter for property address.
* @return Value of property address.
*
*/
public String getAddress() {
return this.address;
}
/** Getter for property phone.
* @return Value of property phone.
*
*/
public String getPhone() {
return this.phone;
}
/** Getter for property balance.
* @return Value of property balance.
*
*/
public double getBalance() {
return this.balance;
}
}
Thanks
Santosh
sjoy@cook-inc.com