Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think I figured it out. It happened to me today. I was just donig some small test with it, and it didn't work. Here's the code: </p> <pre><code> static class TesteP { private String a; private String b; private String c; public String getA() { return this.a; } public void setA(String a) { this.a = a; } public String getB() { return this.b; } public void setB(String b) { this.b = b; } public String getC() { return this.c; } public void setC(String c) { this.c = c; } @Override public String toString() { return new ToStringBuilder(this.getClass()).add("a", this.a).add("b", this.b).toString(); } } static class RestP { private String a; public String getA() { return this.a; } public void setA(String a) { this.a = a; } @Override public String toString() { return this.a; } } public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { TesteP p = new TesteP(); p.setA("AAAA"); p.setB("BBB"); TesteP pp = new TesteP(); RestP p2 = new RestP(); p2.setA("aaaa"); PropertyUtils.copyProperties(p,p2); } </code></pre> <p>It solved this making the classes public. Maybe one of your classes isn't public. Here's the solution in my case:</p> <pre><code> public static class TesteP { private String a; private String b; private String c; public String getA() { return this.a; } public void setA(String a) { this.a = a; } public String getB() { return this.b; } public void setB(String b) { this.b = b; } public String getC() { return this.c; } public void setC(String c) { this.c = c; } @Override public String toString() { return new ToStringBuilder(this.getClass()).add("a", this.a).add("b", this.b).toString(); } } public static class RestP { private String a; public String getA() { return this.a; } public void setA(String a) { this.a = a; } @Override public String toString() { return this.a; } } public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { TesteP p = new TesteP(); p.setA("AAAA"); p.setB("BBB"); TesteP pp = new TesteP(); RestP p2 = new RestP(); p2.setA("aaaa"); PropertyUtils.copyProperties(p,p2); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload