Questions Tagged With classloaderhttps://answers.axonivy.com/tags/classloader/?type=rssquestions tagged <span class="tag">classloader</span>enTue, 09 Jul 2019 07:31:24 -0400Loading classes from WEB-INF/libhttps://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-lib<p>Dear ivyteam</p> <p>In our project we'd like to have the following structure: Our ivy project contains a jar which has some Java interfaces. Then we'd like the implementations for these interfaces in another external jar that we can deploy independently. Our idea was to put into the WEB-INF/lib folder. </p> <p><img alt="alt text" src="https://answers.axonivy.com/upfiles/example.png"></p> <p>But if we try to load the class from the jar (using <code>ClassLoader#loadClass</code>) we get a <code>NoClassDefFound</code> exception. Is there any way to get such a structure to work? Maybe with some class loader magic?</p> <p>Best regards Lars</p>Lars TuchelTue, 09 Jul 2019 07:31:24 -0400https://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-libclassloaderivyHow to load ivy class to class loader on maven pluginhttps://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin<p>Hi ivyteam</p> <p>I'm building a maven plugin to scanning java class in ivy project to generate some business documentation (by reading the annotation in classes). It's seem to work well with java class. </p> <p>There is only one problem with some classes which belong to ivy, for example a java class that extends from <code>ch.ivyteam.ivy.scripting.objects.CompositeObject</code> or a class that references from another class from other ivy project, in maven plugin it could not load those classes like that then throw NoClassDefFoundException, I guess that because <code>CompositeObject</code> does not available on current class loader yet. </p> <p>My question is: How could i resolve those ivy dependencies to load those class? how <code>project-build-plugin</code> can compile them or is there any solutions?</p> <p>Thanks</p>trungdvThu, 29 Mar 2018 11:01:23 -0400https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-pluginclassloaderivy