SerializationUtils.clone issue in Glassfish 3.1.2.2 build 5

1.4k views Asked by At

I am cloning my object using SerializationUtils.clone. The same code is working fine in JBOss EAP 6.0. When i did migration to glassfish 3.1.2.2 while processing i am getting below error

    2013-12-10 16:55:44,069 ERROR ge.nbsm.weGGI.Workflow.WorkflowManager - Exception in Manage Workflow --> 
    org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: ge.nbsm.weGGI.valueObjects.DataContainerVO
        at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:165)
        at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:192)
        at org.apache.commons.lang.SerializationUtils.clone(SerializationUtils.java:80)
        at ge.nbsm.weGGI.Workflow.ObjectInterface.makeDACall(ObjectInterface.java:54)
        at ge.nbsm.weGGI.Workflow.WorkflowManager.makeDACall(WorkflowManager.java:648)
        at ge.nbsm.weGGI.Workflow.WorkflowManager.manageWorkflow(WorkflowManager.java:395)
        at ge.nbsm.weGGI.common.utility.XMLProcessor.parseXML(XMLProcessor.java:487)
        at ge.nbsm.weGGI.queue.QueueManager.processRequest(QueueManager.java:169)

Caused by: java.lang.ClassNotFoundException: ge.nbsm.weGGI.valueObjects.DataContainerVO
    at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:787)
    at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:162)
    ... 66 more

Its strange..The same code didn't create any problem.I am using commons-lang-2.4.jar. Normal java interface cloning is not working for my requirement. Please help to fix this issue and let me know if you require additional details

1

There are 1 answers

0
Karthik On

Since SerializationUtils.clone facing issue I have changed my code to java deep cloning concepts.The deepcloning does the functionality which i expects. Please refer the below link

http://alvinalexander.com/java/java-deep-clone-example-source-code