<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen" rel="nofollow">Sam Brannen</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6050?redirect=false" rel="nofollow">SPR-6050</a></strong> and commented</p>
<p dir="auto">In the Spring TestContext Framework (i.e., specifically in AbstractGenericContextLoader), annotation-driven autowiring is automatically enabled. In other words, all ApplicationContexts created by subclasses of AbstractGenericContextLoader (e.g., GenericXmlContextLoader) are automatically configured to process annotations.</p>
<p dir="auto">If you explicitly wish that annotation processing not be enabled for the configuration files you specify -- for example, if some of the beans are annotated with <code class="notranslate">@Autowired</code>, etc. but you do not want those beans to be autowired -- you are at a loss: there is currently no way to disable this.</p>
<p dir="auto">As indirectly suggested in the forum, it would be nice if Spring provided a mechanism for disabling automatic annotation-driven autowiring in tests.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=74298" rel="nofollow">http://forum.springsource.org/showthread.php?t=74298</a></p>
<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="398086790" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9309" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9309/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9309">#9309</a> Load dedicated child ApplicationContext for test instance in the TestContext framework</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398151000" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14113" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14113/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14113">#14113</a> Test instances should not be proxied in the TestContext framework</li>
</ul>
<p dir="auto">2 votes, 2 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=costin" rel="nofollow">Costin Leau</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4924?redirect=false" rel="nofollow">SPR-4924</a></strong> and commented</p>
<p dir="auto">Probably the error is caused by the usage of a WeakHashMap..</p>
<p dir="auto">Below is the stacktrace:</p>
<p dir="auto">java.lang.NullPointerException<br>
at org.springframework.core.enums.AbstractCachingLabeledEnumResolver.get<br>
LabeledEnumByLabel(AbstractCachingLabeledEnumResolver.java:105)<br>
at org.springframework.osgi.config.AbstractReferenceDefinitionParser.pro<br>
cessCardinalityString(AbstractReferenceDefinitionParser.java:300)<br>
at org.springframework.osgi.config.AbstractReferenceDefinitionParser.det<br>
ermineCardinality(AbstractReferenceDefinitionParser.java:288)<br>
at org.springframework.osgi.config.AbstractReferenceDefinitionParser.app<br>
lyDefaultCardinality(AbstractReferenceDefinitionParser.java:311)<br>
at org.springframework.osgi.config.AbstractReferenceDefinitionParser.doP<br>
arse(AbstractReferenceDefinitionParser.java:223)<br>
at org.springframework.osgi.config.AbstractReferenceDefinitionParser.par<br>
seInternal(AbstractReferenceDefinitionParser.java:181)<br>
at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.pa<br>
rse(AbstractBeanDefinitionParser.java:56)<br>
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(N<br>
amespaceHandlerSupport.java:69)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.4</p>
<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="398089172" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9598" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9598/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9598">#9598</a> NPE in AbstractCachingLabeledEnumResolver during namespace parsing (<em><strong>"duplicates"</strong></em>)</li>
</ul>