weblogic.rmi.UnMarshalException - Can someone please explain?

Discussions

EJB programming & troubleshooting: weblogic.rmi.UnMarshalException - Can someone please explain?

  1. Hi,
    I had posted a message titled ClassNotFoundException yesterday & managed to "fix" it. However, I'm still confused as to how exactly this works.

    My Session Bean's business method promises to accept any object which implements an interface (which extends Serializable). The business method retrieve values from this object with the interface methods.

    Now, the client constructs an arbitrary object which implements this serializable interface & sends it off to the remote method. I get a ClassNotFoundException followed by an weblogic.rmi.UnMarshalException.

    Now, if I copy this arbitrary objects class file into the \weblogic\myserver\serverclasses directory, the remote call works without any exception. I take this to mean that the Bean was not able to access the arbitrary object's class file earlier & now it is able to do so.

    My confusion is - is it not enough for the bean to know that an object implements the specified interface? Why should it have access to a client class file? What about the beans enacapsulation?
    --Das
  2. The class file and it's byte codes are required in order to execute a method. The interfaces allow you to compile the client but an exception will occur if the implementation class is not found. You need to deploy any subclass that you plan to send over the wire in the client jars.

    Otherwise make your behaviour part of a remote object such as a session bean and only send data over the wire.

    Rob