<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=dmitriy" rel="nofollow">Dmitriy Kopylenko</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3257?redirect=false" rel="nofollow">SPR-3257</a></strong> and commented</p>
<p dir="auto">Up until 2.0.3 it worked fine for the groovy bean definitions with the following xml:</p>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p>
<p dir="auto">&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xmlns:lang="<a href="http://www.springframework.org/schema/lang" rel="nofollow">http://www.springframework.org/schema/lang</a>"<br>
xsi:schemaLocation="<br>
<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd</a><br>
<a href="http://www.springframework.org/schema/lang" rel="nofollow">http://www.springframework.org/schema/lang</a> <a href="http://www.springframework.org/schema/lang/spring-lang-2.0.xsd" rel="nofollow">http://www.springframework.org/schema/lang/spring-lang-2.0.xsd</a>"<br>
default-init-method="init"&gt;</p>
<p dir="auto">&lt;lang:groovy id="someGroovyBean" script-source="classpath:com/mycompany/SomeGroovyBean.groovy"&gt;<br>
&lt;lang:property name="dataSource" ref="dataSource"/&gt;<br>
&lt;/lang:groovy&gt;</p>
<p dir="auto">but it fails in 2.0.3 with the following exception:</p>
<p dir="auto">org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace <a href="http://www.springframework.org/schema/lang" rel="nofollow">http://www.springframework.org/schema/lang</a><br>
Offending resource: class path resource [testContext.xml]</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
.... etc."><pre class="notranslate"><code class="notranslate">at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
.... etc.
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.3</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12470/lang-namespace-handler-case.zip" rel="nofollow">lang-namespace-handler-case.zip</a> (<em>4.65 MB</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="398076154" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7935" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7935/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7935">#7935</a> LangNamespaceHandler cannot be registered in DefaultNamespaceHandlerResolver when thrid party library is not found (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398076269" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7947" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7947/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7947">#7947</a> Increase log level for NamespaceHandler exception reporting</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=rstoya05-aop" rel="nofollow">Rossen Stoyanchev</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9288?redirect=false" rel="nofollow">SPR-9288</a></strong> and commented</p>
<p dir="auto">The failure occurs when I run all spring-context tests from the command line. It doesn't fail when running the test alone, the tests in the same package, or all tests inside Eclipse.</p>
<p dir="auto">The test creates an MBeanServer via <code class="notranslate">javax.management.MBeanServerFactory</code>, then tries to check if an <code class="notranslate">MBeanServerFactoryBean</code> will locate that same instance. The assertSame on line 65 fails because more than one MBeanServer instances were found and the first one returned was not the same instance.</p>
<p dir="auto">Running gradle in debug mode and using breakpoints in addMBeanServer() and removeMBeanServer() of MBeanServerFactory, I was able to find one case where an MBeanServer is added but not removed. It happens in <code class="notranslate">AdvisedJRubyScriptFactoryTests</code> inside JRuby itself when Spring tries to load a script via JRubyScriptFactory. So it looks like a side effect, which explains why the failure doesn't occur when running a single test but not why it doesn't fail inside Eclipse.</p>
<p dir="auto">I experimented with a tearDown() method in <code class="notranslate">AdvisedJRubyScriptFactoryTests</code>, which looks for and releases any MBeanServers it finds but that caused a failure in <code class="notranslate">JmxUtilsTests.testLocatePlatformMBeanServer</code>. So clearly not a good fix. Furthermore the fact this is an environment-sensitive issue makes even more hesitant to go any further.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.2 M1</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="398155119" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14664" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14664/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14664">#14664</a> MBeanServerFactoryBeanTests.testWithLocateExistingAndExistingServer failing (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398155121" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14665" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14665/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14665">#14665</a> JmxUtilsTests.testLocatePlatformMBeanServer failing (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">1 votes, 5 watchers</p>