can ejb return an interface?

Discussions

EJB design: can ejb return an interface?

  1. can ejb return an interface? (5 messages)

    Has anyone ever returned an interface from an EJB?
     
    I get the following error from my app server(Orion):
    com.evermind.server.rmi.OrionRemoteException: Error (de-)serializing object: MyInterfaceImpl
     
     
    Here is my Remote Interface:
    public interface Test extends EJBObject
    {
        public IMyInterface getInterface()
            throws RemoteException;
    }

     
    Here is the implmentation of the method:
        public IMyInterface getInterface()
            throws RemoteException
        {
            return new MyInterfaceImpl();
        }

     
    Thanks,
    Paul

    Threaded Messages (5)

  2. can ejb return an interface?[ Go to top ]

    Yes. You just have to make sure that the object that implements your interface implements java.io.Serializable as well.

    Reza
  3. can ejb return an interface?[ Go to top ]

    Or you could make your interface extend Serializable.

    Which option you take depends on whether you want ALL implementations of your interface to be Serializable or just the one implementation.

    Chz

    Tony
  4. can ejb return an interface?[ Go to top ]

    Ok, by having my interface extend Serializable it works.

    Now I'm have trouble passing back the interface for a dynamic proxy object that implements the interface.

    Any ideas?
  5. can ejb return an interface?[ Go to top ]

    What is the problem you're having. What's the error / stack trace?

    Chz

    Tony
  6. can ejb return an interface?[ Go to top ]

    Nevermind. I updated to the latest version of Orion 1.5.2 and everything is working great.

    Thanks again for all the help.

    -Paul