Details
-
Bug
-
Resolution: Done
-
Major
-
None
-
None
Description
When there is a shared object between a client (WAR) and server (EJB/EAR) and its class and parent class are part of a non-shared library (e.g., the class and parent class are present in both the client WAR and server EAR), the following exception occurs when SerializingCloner.clone is called on the object (note that the object class is Serializable and its parent class is not):
Caused by: java.lang.IllegalArgumentException: No matching constructor at org.jboss.marshalling.reflect.SerializableClass.invokeConstructorNoException(SerializableClass.java:527) at org.jboss.marshalling.reflect.SerializableClass.callNonInitConstructor(SerializableClass.java:498) at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:246)
The problem seems to be that cloneInfo.callNonInitConstructor ends up getting called using the parent class of the original object class instead of using the parent class of the cloned object class. Since the nonInitConstructors associated with cloneInfo won't have a key that matches the parent class of the original object class, the above exception occurs.