<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=david@davidkarlsen.com" rel="nofollow">David J. M. Karlsen</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4456?redirect=false" rel="nofollow">SPR-4456</a></strong> and commented</p>
<p dir="auto">Please se attached class ApplicationContextReaderImpl.java .<br>
Testcase:<br>
We tried to get this class <code class="notranslate">@Autowired</code> into a consumer of the class (The consumer declares <code class="notranslate">@Autowired</code> on the interface).</p>
<p dir="auto">Observations:</p>
<ol dir="auto">
<li>If used as is - Spring finds no match (expecting 1 unique bean - finds none).</li>
<li>If it's not defined in the spring context as a <code class="notranslate">@Component</code> but defined in xml - it will be found!</li>
<li>If the inner Cache class is defined as a static class - autowiring ( 1) ) will succeed.</li>
</ol>
<p dir="auto">So this clearly has to be an autowiring bug.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/13637/ApplicationContextReaderImpl.java" rel="nofollow">ApplicationContextReaderImpl.java</a> (<em>8.46 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398084522" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9003" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9003/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9003">#9003</a> component scanning incorrectly excludes classes (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=arnaud.nauwynck" rel="nofollow">Arnaud Nauwynck</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8531?redirect=false" rel="nofollow">SPR-8531</a></strong> and commented</p>
<p dir="auto">the META-INF/ is a hidden package for isolated ClassLoader, for example as osgi Netbeans plugins</p>
<p dir="auto">Suppose you want to use Spring in your netbeans plugins application, and your application in split into several plugins depending of each others, you can not start the ClassPathXmlApplicationContext, because it fails to validate xml files, as none of the META-INF/spring.handlers are seen by the ClassLoader of your plugin.</p>
<p dir="auto">Unfortunately, this resource name "META-INF/spring.handlers" is hard-coded in org.springframework.beans.factory.xml.PluggableSchemaResolver and the stack calling this constructor from ClassPathXmlApplicationContext is extremely difficult (impossible?) to customize so as to change the default value.</p>
<p dir="auto">Would it be possible to use another (additionnal) resource name than "META-INF/spring.handlers", for example "org/springframework/spring.handlers" ? A simple migration plan would be to search for both names, and simply concatenate results : no backward compatible problem, and no more problem with all these strange isolated ClassLoader such as osgi, Netbeans, JavaWebStart...</p>
<hr>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398112498" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13015" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13015/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13015">#13015</a> Spring XSD validation fails in the presence of non-standard classloaders due to problems resolving "schema.handlers" etc. (<em><strong>"duplicates"</strong></em>)</li>
</ul>