Hello,
I'm migrating a web application from Weblogic 8 to Weblogic 9 (in the same times, I'm migrating from Java 1.4 to Java 1.5).
The application has been splitted into 2 parts:
- Object part : an ear file with the business (EJB) and database (DTO) layers.
- Presentation part : a war file with the presentation layer.
The communication between the two parts has been based T3 protocol with the POJO's as parameters and return values.
During the source file migration:
- For the object part, I placed annotation into the code for EJB class (to be used with EJBGen)
- For the Object and Presentation parts, I update the source file to remove "enum" variable name.
Now when the Presentation part try to get some POJO with Set, List or Map, I received the following error:
Code:
java.lang.ClassCastException: cannot assign instance of net.sf.hibernate.impl.SessionImpl$CollectionEntry to field net.sf.hibernate.collection.PersistentCollection.collectionSnapshot of type net.sf.hibernate.engine.CollectionSnapshot in instance of net.sf.hibernate.collection.Set
at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1977)
at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1157)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1918)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1628)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at weblogic.rmi.extensions.server.CBVInputStream.readObjectInternal(CBVInputStream.java:71)
at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:65)
at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:100)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at eu.cec.admin.ndp.object.scan.DemoService_8jx1fn_EOImpl_920_WLStub.testConnections6(Unknown Source)
at eu.cec.admin.ndp.presentation.util.BaseAction.execute(BaseAction.java:84)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at eu.cec.admin.ndp.presentation.util.LongWaitRequestProcessor.processActionPerform(LongWaitRequestProcessor.java:96)
But when I try to used the same method on the same EJB but with a JUnit test: all works.
After some debugging, the errors occurs when the "return" has been done.
I performed several search on this forum or on the net, but I didn't find an answer to my problem.
I'm very happy to find a solution at my problem.
These are some usefull information:
Hibernate version: 2
Mapping documents:One of the POJO used:
Code:
public class TypeDocRef implements Serializable, Comparable, ITypeDocRef {
private String description;
private String rtdCd;
private Long rtdId;
private String utilCreat;
private String utilModif;
private Timestamp dateCreat;
private Timestamp dateModif;
private Module module;
private Set typeDocLibelles;
/**.... Setter and Getter */
}
Name and version of the database you are using: Oracle 9.2.0.8.0