How can I implement toString() method in my EJB?

Joseph vijay Raj

I have implementation in my ejb-implementation class:
  public String toString() {
      return new String(" User id =" + m_id +"; ");

and in the remote interface
  public java.lang.String toString() throws RemoteException;

But I got this error message:
... method toString() in interface userEntity cannot override method toString() in class java.lang.Object, overridden method does not throw java.rmi.RemoteException at line 12, column 27
I think this is not possible because the toString() defined in the Remote Interface should throw RemoteException.

It will not be compatible with java.lang.String java.lang.Object.toString() method.

Hence I think its not possible.