RestComm / jain-slee

The World's #1 Open Source JAIN-SLEE (JSLEE) 1.1 Implementation
http://www.restcomm.com/
GNU Affero General Public License v3.0
24 stars 50 forks source link

[tck] makeDeepCopy replacement #89

Closed SergeyLee closed 7 years ago

SergeyLee commented 7 years ago

When I was finishing migrating to WildFly I decided to replace JBoss Serialization library with using org.apache.commons.lang.SerializationUtils.clone() in ObjectCloner._makeDeepCopy(): https://github.com/RestComm/jain-slee/blob/master/container/spi/src/main/java/org/mobicents/slee/container/util/ObjectCloner.java#L73-L116

You can see there are commented old code with JBossObjectInputStream/JBossObjectOutputStream and new code with org.apache.commons.lang.SerializationUtils.clone().

Now I have error with several tests, like tests/profiles/profiletable/Test1110132Test.xml.

From TCK result: Exception: com.opencloud.sleetck.lib.TCKCommunicationException => RemoteException caught while executing remote MBeanServer method. Nested exception: Exception: java.rmi.UnmarshalException => Error unmarshaling return; nested exception is: java.lang.ClassNotFoundException: org.apache.commons.lang.SerializationException Stack Trace: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is: java.lang.ClassNotFoundException: org.apache.commons.lang.SerializationException at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:246) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161) at com.opencloud.sleetck.lib.infra.jmx.MBeanFacadeAgentRemoteImpl_Stub.invoke(Unknown Source) at com.opencloud.sleetck.lib.infra.jmx.MBeanFacadeImpl.invoke(Unknown Source) at com.opencloud.sleetck.lib.testutils.jmx.impl.ProfileProvisioningMBeanProxyImpl.createProfileTable(Unknown Source) ...

From JSLEE terminal: 12:55:38,620 INFO [org.mobicents.slee.container.util.ObjectCloner] (RMI TCP Connection(5)-127.0.0.1) ObjectCloner._makeDeepCopy: javax.slee.Address 12:55:38,620 INFO [org.mobicents.slee.container.util.ObjectCloner] (RMI TCP Connection(5)-127.0.0.1) ObjectCloner._makeDeepCopy: SLEE Profile: XY/0 12:55:38,623 TRACE [org.mobicents.slee.container.profile.ProfileCallRecorderTransactionData] (RMI TCP Connection(5)-127.0.0.1) Removing call to profile. Key[Test1110132ProfileTable-null] 12:55:38,623 ERROR [org.mobicents.slee.container.profile.ProfileObject] (RMI TCP Connection(5)-127.0.0.1) Runtime exception when invoking concrete profile! Setting tx for rollback and invalidating object: javax.slee.SLEEException: Failed to create object copy. at org.mobicents.slee.container.util.ObjectCloner._makeDeepCopy(ObjectCloner.java:112) at org.mobicents.slee.container.util.ObjectCloner.makeDeepCopy(ObjectCloner.java:68) at com.opencloud.sleetck.lib.testsuite.profiles.profiletable.Test1110132ProfileCMPImpl.setAddress(Test1110132ProfileCMPImpl.java) ... Caused by: java.lang.ClassNotFoundException: javax.slee.Address from [Module "org.apache.commons.lang:main" from local module loader @31b7dea0 (finder: local module finder @3ac42916 (roots: /opt/mobicents/restcomm-slee-3.0.Alpha/wildfly-10.1.0.Final/modules,/opt/mobicents/restcomm-slee-3.0.Alpha/wildfly-10.1.0.Final/modules/system/layers/base))]

I fixed this error: added dependency on JSLEE container lib (modules):

into org/apache/commons/lang/main/module.xml.

But I think that it is not good solution.