<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=skaffman" rel="nofollow">Kenny MacLeod</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6234?redirect=false" rel="nofollow">SPR-6234</a></strong> and commented</p>
<p dir="auto">With EhCach you can register event listeners with individual caches. Unfortunately, Spring's EhCacheFactoryBean does not provide the facility for configuring these.</p>
<p dir="auto">We still have the option of configuring the caches in ehcache.xml (see <a href="http://ehcache.org/EhcacheUserGuide.html#id.s28" rel="nofollow">http://ehcache.org/EhcacheUserGuide.html#id.s28</a>), but I much prefer doing this via EhCacheFactoryBean.</p>
<p dir="auto">I suggest being able to inject a List of CacheEventListenerFactory objects into EhCacheFactoryBean, which would then register them with the cache it creates.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6, 3.0 M4</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="398094211" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10312" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10312/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10312">#10312</a> EhCacheFactoryBean should support CacheEventListener (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/747300f34ce80dca644b82d314b8ebb727b4882e/hovercard" href="https://github.com/spring-projects/spring-framework/commit/747300f34ce80dca644b82d314b8ebb727b4882e"><tt>747300f</tt></a></p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jhaile" rel="nofollow">Jeremy Haile</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5324?redirect=false" rel="nofollow">SPR-5324</a></strong> and commented</p>
<p dir="auto">The "scanPackages" property requires the package name to have a trailing "." which is inconsistent with the component-scan.  This feature was adding by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398087697" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9415" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9415/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9415">#9415</a></p>
<p dir="auto">ClassPathScanningCandidateComponentProvider (used by component-scan) constructs the scanning pattern like this:<br>
String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + resolveBasePackage(basePackage) + "/" + this.resourcePattern;</p>
<p dir="auto">AnnotationSessionFactoryBean constructs the scanning pattern like this:<br>
String pattern = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath(pkg) + RESOURCE_PATTERN;</p>
<p dir="auto">Notice the missing "/" in the hibernate class.  This means that the resource pattern is constructed like classpath*:myPackage**/<strong>.class instead of classpath</strong>:myPackage/**/*.class</p>
<p dir="auto">This works when all persistence classes are in the package to be scanned, but fails to scan subclasses.  AnnotationSessionFactoryBean should be changed to construct its pattern like component-scan does.</p>
<p dir="auto">A workaround is to append a trailing "." onto the end of your package name.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6</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="398097073" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10711" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10711/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10711">#10711</a> AnnotationSessionFactoryBean packagesToScan in a OSGi environment (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/71df72d6341015c8b27f574c2d1a2be926e4fadb/hovercard" href="https://github.com/spring-projects/spring-framework/commit/71df72d6341015c8b27f574c2d1a2be926e4fadb"><tt>71df72d</tt></a></p>