How are you loading your classes?
Are you using Class.forName ?
If you are, then that may be the cause of your problems. In JBoss you should not use the system classloader, as that one does not handle the hot deployment, the UnifiedClassloaders et al. You should use
No, I am not using Class.forName. I am using ClassLoader.defineName. I believe the problem stems from the ClassLoader. Although it does not solve my original problem, using Thread.currentThread().getContextClassLoader().loadClass() alleviates the problem a little bit. For this, I have to put colored apples in a Jar and then drop that Jar in the lib directory of my server.
Again, if I stick to my original implementation (i.e., reading class files from the filesystem, populating byte arrays, and then calling defineClass()) I am still hosed.
Thanks for your suggestion, though.
You need to delegate the class loading to the cloass loader for the deployment that FruitHarvester was loaded by. The NoClassDefFoundError error is caused by same classes being loaded by two seperate class loaders.
Make your custom class loader delegate to: