<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=paulm" rel="nofollow">Paul Middelkoop</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8494?redirect=false" rel="nofollow">SPR-8494</a></strong> and commented</p>
<p dir="auto">I have <code class="notranslate">@Configuration</code> Spring configuration with <code class="notranslate">@EnableTransactionManagement</code> and a <code class="notranslate">@ImportResource</code>. In the imported resource I use cache:annotation-driven/. This results in: java.lang.IllegalArgumentException: Class name [null] is not a known auto-proxy creator class</p>
<p dir="auto">When I use &lt;tx:annotation-driven /&gt; instead of <code class="notranslate">@EnableTransactionManagement</code> everything works fine.</p>
<p dir="auto">Problem also exists in nightly build of June 27th.</p>
<p dir="auto">Complete stacktrace:<br>
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.IllegalArgumentException: Class name [null] is not a known auto-proxy creator class<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)<br>
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:293)<br>
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:118)<br>
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:105)<br>
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:264)<br>
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigurationClasses(ConfigurationClassPostProcessor.java:199)<br>
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:175)<br>
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:617)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)<br>
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:102)<br>
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)<br>
at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)<br>
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:149)<br>
... 24 more<br>
Caused by: java.lang.IllegalArgumentException: Class name [null] is not a known auto-proxy creator class<br>
at org.springframework.aop.config.AopConfigUtils.findPriorityForClass(AopConfigUtils.java:140)<br>
at org.springframework.aop.config.AopConfigUtils.registerOrEscalateApcAsRequired(AopConfigUtils.java:113)<br>
at org.springframework.aop.config.AopConfigUtils.registerAutoProxyCreatorIfNecessary(AopConfigUtils.java:74)<br>
at org.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(AopNamespaceUtils.java:58)<br>
at org.springframework.cache.config.AnnotationDrivenCacheBeanDefinitionParser$AopAutoProxyConfigurer.configureAutoProxyCreator(AnnotationDrivenCacheBeanDefinitionParser.java:109)<br>
at org.springframework.cache.config.AnnotationDrivenCacheBeanDefinitionParser.parse(AnnotationDrivenCacheBeanDefinitionParser.java:67)<br>
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1414)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1404)<br>
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)<br>
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)<br>
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)<br>
... 41 more</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 M2</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="398112768" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13058" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13058/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13058">#13058</a> <code class="notranslate">@EnableTransactionManagement</code> does not handle APC escalation (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398114794" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13375" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13375/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13375">#13375</a> Unable to use <code class="notranslate">@EnableTransactionManagement</code> along with &lt;cache:annotation-driven /&gt; (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=hannes.schmidt" rel="nofollow">Hannes Schmidt</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8662?redirect=false" rel="nofollow">SPR-8662</a></strong> and commented</p>
<p dir="auto">The basic problem is that UriTemplate first substitutes the template variables into a single string and then encodes that string as a whole using URIUtils. This simply can't work reliably because the substitution could produce a string that is impossible to parse using a regular expression for URLs. For example, the following template</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="http://foo.com/things/{thingId}"><pre class="notranslate"><code class="notranslate">http://foo.com/things/{thingId}
</code></pre></div>
<p dir="auto">with the following value for thingId</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a/b"><pre class="notranslate"><code class="notranslate">a/b
</code></pre></div>
<p dir="auto">produces the following string after substitution</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="http://foo.com/things/a/b"><pre class="notranslate"><code class="notranslate">http://foo.com/things/a/b
</code></pre></div>
<p dir="auto">When URIUtil does not encode the / between a and b because it takes the slash literally. This is what I would expect in this case:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="http://foo.com/things/a%2Fb"><pre class="notranslate"><code class="notranslate">http://foo.com/things/a%2Fb
</code></pre></div>
<p dir="auto">The reason we have URL-encoding is so we can embed any string into a URL without breaking it. But we need to encode the embedded string BEFORE we embed it. We can't expect URIUtils to be able to fix a URL that we broke by embedding an unencoded string.</p>
<p dir="auto">Now, depending on where we embed a string into a URL certain characters loose their special meaning. The slash, for example, has no special meaning in the query part. If we want to produce URLs without redundantly encoded parts, we need to take the context into account. Nevertheless, it is always safe to encode all special characters in each embedded string and that would be a simple fix.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</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="398112692" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13050" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13050/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13050">#13050</a> UriTemplate doesn't encode query parameters</li>
<li><a href="https://jira.spring.io/browse/INT-2569" rel="nofollow">INT-2569</a> Refactor HttpOutboundGateway to mitigate breaking changes due to UriTemplate changes in Spring 3.1</li>
</ul>