<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=dward_alfresco" rel="nofollow">David Ward</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6411?redirect=false" rel="nofollow">SPR-6411</a></strong> and commented</p>
<p dir="auto">At alfresco, we have a large number of spring bean files containing wildcard imports such as this</p>
<p dir="auto">&lt;beans&gt;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;import resource=&quot;classpath*:alfresco/module-context.xml&quot; /&gt;
&lt;import resource=&quot;classpath*:alfresco/enterprise/*-context.xml&quot;/&gt;"><pre class="notranslate"><code class="notranslate">&lt;import resource="classpath*:alfresco/module-context.xml" /&gt;
&lt;import resource="classpath*:alfresco/enterprise/*-context.xml"/&gt;
</code></pre></div>
<p dir="auto">&lt;/beans&gt;</p>
<p dir="auto">Unfortunately, this no longer works with Spring 3.0 RC2.</p>
<p dir="auto">I have tracked down the problem to</p>
<p dir="auto">org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(Element)</p>
<p dir="auto">and have successfully fixed the issue in my own subclass with the following change</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="        // Discover whether the location is an absolute or relative URI
        boolean absoluteLocation = false;

        try
        {
            absoluteLocation = location.startsWith(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX) // ADDED THIS LINE
                    || ResourceUtils.toURI(location).isAbsolute();
        }
        catch (Exception ex)
        {
            // cannot convert to an URI, considering the location relative
        }"><pre class="notranslate"><code class="notranslate">        // Discover whether the location is an absolute or relative URI
        boolean absoluteLocation = false;

        try
        {
            absoluteLocation = location.startsWith(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX) // ADDED THIS LINE
                    || ResourceUtils.toURI(location).isAbsolute();
        }
        catch (Exception ex)
        {
            // cannot convert to an URI, considering the location relative
        }
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC2</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="398099258" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11032" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11032/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11032">#11032</a> Cannot import bean definitions using classpath*: resource location (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=tziem" rel="nofollow">Thomas Ziem</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7908?redirect=false" rel="nofollow">SPR-7908</a></strong> and commented</p>
<p dir="auto">In cases if a HttpResponse contains no content (e.g. if status code is 204), no Content-Type header will be sent.<br>
But HttpMessageConverterExtractor expects always a Content-Type header:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public T extractData(ClientHttpResponse response) throws IOException {
    MediaType contentType = response.getHeaders().getContentType();
    if (contentType == null) {
        throw new RestClientException(&quot;Cannot extract response: no Content-Type found&quot;);
    }
    ...
}"><pre class="notranslate"><code class="notranslate">public T extractData(ClientHttpResponse response) throws IOException {
    MediaType contentType = response.getHeaders().getContentType();
    if (contentType == null) {
        throw new RestClientException("Cannot extract response: no Content-Type found");
    }
    ...
}
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/17610/RestTemplateTests.java" rel="nofollow">RestTemplateTests.java</a> (<em>2.59 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="398112236" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12970" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12970/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12970">#12970</a> HttpMessageConverterExtractor throws RestClientException if no Content-Type header was found in HttpRespone (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a href="https://jira.spring.io/browse/ROO-2274" rel="nofollow">ROO-2274</a> Sending back ResponseEntity without Content-Type header causes RestClientExceptions when using RestTemplate</li>
</ul>
<p dir="auto">3 votes, 2 watchers</p>