<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Loading classes from WEB-INF/lib</title><link>https://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-lib</link><description>&lt;p&gt;Dear ivyteam&lt;/p&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;&lt;img alt="alt text" src="https://answers.axonivy.com/upfiles/example.png"&gt;&lt;/p&gt;
&lt;p&gt;But if we try to load the class from the jar (using &lt;code&gt;ClassLoader#loadClass&lt;/code&gt;) we get a &lt;code&gt;NoClassDefFound&lt;/code&gt; exception. Is there any way to get such a structure to work? Maybe with some class loader magic?&lt;/p&gt;
&lt;p&gt;Best regards
Lars&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-lib" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 09 Jul 2019 11:28:32 -0400</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-lib/3882</link><description>&lt;p&gt;Hi Lars&lt;/p&gt;
&lt;p&gt;This will not work because the class loader hierarchy is exactly the opposite. This means the projects class loader has the web application class loader as parent. E.g. the project can load classes from WEB-INF/lib but not vice versa. &lt;/p&gt;
&lt;p&gt;Can you tell me the use case behing your question? &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Reto Weiss, Axon.ivy Support&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Tue, 09 Jul 2019 11:28:32 -0400</pubDate><guid>https://answers.axonivy.com/questions/3879/loading-classes-from-web-inf-lib/3882</guid></item></channel></rss>