CL needs to be serializable.
Mukul Gandhi wrote:
> Hi ,
> I am invoking a method getDetails(param1, param2) of
> stateless session bean from a servlet. The method is
> returning java.util.Vector. I am adding objects in
> this vector all of which are instances of class CL
> whose definition is
> public Class CL {
> private variable x;
> private variable y;
>
> public setter method for x;
> public setter method for y;
> public getter method for x;
> public getter method for y;
> }
> I have written the following code to populate the
> vector in EJB ,
> Vector vec = new Vector();
> CL cl1 = new CL();
> cl1.setterforX(val1);
> cl1.setterforY(val2);
> vec.addElement((Objct)cl1);
> Similary I am adding few other objects(cl2, cl2 etc)
> in the vector vec. The EJB method is then returning
> this vector to the client(which is a servlet). When I
> invoke the method getDetails(param1, param2) from
> servlet { as Vector result =
> remote_object.getDetails(param1, param2) }, I get this
> error on the browser :
> "
> java.rmi.ServerException: RemoteException occurred in
> server thread; nested exception is:
> java.rmi.MarshalException: Exception occurred in
> server thread; nested exception is:
> java.io.NotSerializableException
> "
> My Servlet and EJB are running on the same machine and
> my server platform is WebSphere Application Server
> 3.5 . When I tested the program in VisualAge for Java
> 3.5 's EJB test environment, I get
> java.lang.ClassCastException { when I invoked method
> getDetails(param1, param2) }.
>
> Any help will be much appreciated.
>
> Regards
> -mukul
>
> Siemens Information Systems Ltd
> Tower (B), Plot 6A, Sector-18
> HUDA Area, Gurgaon
> Haryana -122 015, India
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".