users@glassfish.java.net

EJB serialization problem : please help

From: <glassfish_at_javadesktop.org>
Date: Tue, 15 Apr 2008 17:56:39 PDT

Hi everybody,

I have a big problem with my web application and it's interaction with ejb session bean.

When I create an object Account in my web application and persist it with my session bean, here's no problems. But if the account have a collection of Phone object, I have an exception.

Here the beginning of my stack trace :
javax.servlet.ServletException: javax.ejb.EJBException: nested exception is: java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested exception is:
        org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace----------
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9684)
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9699)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1042)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:896)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:890)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:880)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:511)
        at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:386)
        at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:547)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
        at java.util.ArrayList.readObject(ArrayList.java:593)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...

Here's my entities :

@Entity
public class Account implements Serializable {
    private static final long serialVersionUID = 1L;
    private Long id;
    private Collection<Phone> phones = new ArrayList<Phone>();

    public void setId(Long id) {
        this.id = id;
    }

    @OneToMany
    public Collection<Phone> getPhones() {
        return phones;
    }

    public void setPhones(Collection phones) {
        this.phones = phones;
    }
}


@Entity
public class Phone implements Serializable {
    private static final long serialVersionUID = 1L;
    private Long id;

    public void setId(Long id) {
        this.id = id;
    }
    

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }
}

If somebody have an Idea, you'll be come my GOD !!!
Please help me !!!
[Message sent by forum member 'nemesis74100' (nemesis74100)]

http://forums.java.net/jive/thread.jspa?messageID=269393