Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.zkoss.lang.SystemException:java.io.NotSerializableException:com.kawa.sys.pub.DataAccessObjectat #2786

Open
Cici-Musse-Lee opened this issue May 31, 2022 · 0 comments

Comments

@Cici-Musse-Lee
Copy link

The file path is org.zkoss.lang.Object.

source code:

public static final object clone(Object o){
      if (o =null)
      return o;

      try{
            final Class<?>kls = o.getclass();
            if (kls.isArray())
                  return Arraysx.duplicate(o);

            if (o instanceof Cloneable){
                  try{
                        return kls.getMethod("clone").invoke (o);
                  }catch (NoSuchMethodException ex)(
                        if (log.isDebugEnabled())log.debug("No clone()for "+kls);
                  }
            }
      //TODO:Marshalledobject is said with very bad performance,change it
      //if exists other good deep clone method.
      return new Marshalledobject<object>(o).get ();
      }catch (Exception ex){
            throw SystemException.Aide.wrap(ex);
      }
}

test code:

@Test
public void test_clone_2_52()throws NoSuchFieldException,IllegalAccessException{

        java.lang.Object object0=new         com.kawa.familytree.main.bs.PersonalDAO();
        org.zkoss.lang.Objects.clone(object0);
}

test results:

org.zkoss.lang.SystemException:java.io.NotSerializableException:com.kawa.sys.pub.DataAccessObjectat java.base/jdk.internal.reflect.NativeConstructorAccessorlmpl.newlnstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorlmpl.newlnstance(NativeConstructorAccessorlmpl.javaat java.base/jdk.internal.reflect.DelegatingConstructorAccessorlmpl.newlnstance(DelegatingConstructorAccessorat java.base/java.lang.reflect.Constructor.newlnstanceWithCaller(Constructor.java:499)at java.base/java.lang.reflect.Constructor.newlnstance(Constructor.java:480)
Sat org.zkoss.lang.Classes.newlnstance(Classes.java:76)
at org.zkoss.lang.Exceptions.wrap(Exceptions.java:163)
at org.zkoss.lang.SystemException$Aide.wrap(SystemException.java:43)at org.zkoss.lang.Objects.clone(Objects.java:441)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant