0

So I'm attempting to deep copy some custom objects using the Cloner library. I was able to get the code typed out without errors and the import working, but the moment it runs it gives me a NoClassDefFoundError: sun.reflect.ReflectionFactory at org.objenesis.instantiator.

So basically, it's failing to recognize the cloner library for some reason. I cannot figure this out. I found this thread but it is getting old and has no answer as of yet. NoClassDefFoundError when using objenesis on Android

Any help would be very much appreciated.

Community
  • 1
  • 1
  • possible duplicate of [NoClassDefFoundError when using objenesis on Android](http://stackoverflow.com/questions/12333342/noclassdeffounderror-when-using-objenesis-on-android) – Stephen C Apr 13 '14 at 02:31
  • Please don't do this. If you want to get a better answer for an old Question, the correct thing to do is to post a bonus. – Stephen C Apr 13 '14 at 02:33
  • @Stephen C Thanks. Will definitely do that from here on out – logan_izer10 Apr 13 '14 at 02:40
  • Turns out Cloner is NOT compatible with Android. A different method will need to be used – logan_izer10 Apr 23 '14 at 04:14

1 Answers1

0

When we compile java source, we end up with .class files for each class in our program. These binary files are the bytecode that Java interprets to execute your program. The NoClassDefFoundError indicates that the classloader, which is responsible for dynamically loading classes, cannot find the .class file for the class that you're trying to use.

It probably indicates that you haven't set the classpath option when executing your code. Try setting the classpath when you execute.

Hope this helps.. :)

Rashad
  • 11,057
  • 4
  • 45
  • 73
  • This might help.. http://javarevisited.blogspot.com/2011/06/noclassdeffounderror-exception-in.html – Rashad Apr 13 '14 at 02:36
  • The problem is much more complicated than this. Objenesis appears to be doing dynamic code generation. This is not simply a matter of missing JARs. – Stephen C Apr 13 '14 at 03:18