Hi,

I am using Weblogic 5.1 on NT and am getting a
UnmarshalException, followed by a InvalidClassException
stating that my class is not serializable.

I am trying to return an ArrayList of Business objects
with a call to a Stateless Session Bean.

Here is a sampled Business class definition:
// Business Remote Interface
package rhino;


public class Business implements java.io.Serializable
{
        private String m_sBusinessName="";
        private String m_sID="";
        private String m_sPhone="";
        public Business(String p_sID, String p_sName,String p_sPhone)
        {
                m_sBusinessName=new String(p_sName);
                m_sID=new String(p_sID);
                m_sPhone=new String(p_sPhone);
        }
        public String getBusinessName(){return new String(m_sBusinessName);}
        public String getID(){return new String(m_sID);}
        public String getPhone(){return new String(m_sPhone);}
}

And here is a sampled SLSB function:

public ArrayList getBusiness(String p_sBusinessName) throws RemoteException
{
                  ArrayList al=new ArrayList(10);
                  al.add(new Business("10","Big 10", "530-111-2221"));
                  al.add(new Business("11","Big 11", "530-111-2222"));
                  al.add(new Business("12","Big 12", "530-111-2223"));
                  al.add(new Business("13","Big 13", "530-111-2224"));
                  return al;
}

On the client APP I am doing:

  ArrayList al=qb.getBusiness("Big");
  System.err.println("calling al.iterator()");
  Iterator itr=al.iterator();
  Business biz=null;

  System.err.println("calling itr.hasNext()");
  while(itr.hasNext())
  {
  System.err.println("next()");
        biz=(Business)itr.next();
        System.out.println("found: " + biz.getBusinessName()                           
                                  +      biz.getID()                                   
                           +      biz.getPhone());
  }

The error I get is:

         weblogic.rmi.UnmarshalException: Unmarshalling return
  - with nested exception:
[java.io.InvalidClassException: rhino.Business; is not Serializable]

Can someone help in identifying the problem?

Thanks,
Joel

--
RHINO Systems Inc.
Consulting For Your Business
Project Manager &
     Programmer {JAVA & J2EE,ORACLE,HTML & JAVASCRIPT,
                UNIX,C/C++, ESRI-GIS, SMART CARDS}
http://www.rhinosystemsinc.com
530-888-6248 x205

===========================================================================
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".

Reply via email to