You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1.Using spring mvc 3.0, create a controller called MarketQuotesController
2. Create a method like this one on the controller:
@RequestMapping(value="/commodity", method=RequestMethod.GET)
public @ResponseBody Commodity getCommodity(@RequestParam int commodityId) {
return this.getReferenceDataService().getCommodity(commodityId);
}
3. Create an interface of a DAO to get the commodity:
public interface CommodityLookupDAO {
public Commodity getCommodityById(Integer commodityId);
}
4. Create the implementation
public class CommodityLookupDAOImpl implements CommodityLookupDAO {
(...)
@Override
@Cacheable(cacheName="commodityCache")
public Commodity getCommodityById(Integer commodityId) {
return super.find(commoditySqlById, new CommodityLookupMapper(), commodityId);
}
}
5.Implementing ReferenceDataService:
@Override
public Commodity getCommodity(Integer id) {
return commodityDAO.getCommodityById(id);
}
6. Setting up this spring context:
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache.xml" />
</bean>
<ehcache:config cache-manager="cacheManager">
<ehcache:evict-expired-elements interval="60" />
</ehcache:config>
<ehcache:annotation-driven cache-manager="cacheManager" />
7. Having this as ehcache.xml
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
<defaultCache eternal="false" maxElementsInMemory="500" overflowToDisk="false" />
<cache name="commodityCache" maxElementsInMemory="500" eternal="false" overflowToDisk="false" />
</ehcache>
8. Have spring injecting:
-The implementation of the service in the controller.
-The implementation of the DAO in the service.
What is the expected output? What do you see instead?
The expected output is the interceptor generating the key for the cache. This
is all I get on the logging side after executing several requests to the
"cached" method:
<oct 14 18:26:36.120> <DEBUG> <net.sf.ehcache.config.ConfigurationFactory:148>
- Configuring ehcache from InputStream
<oct 14 18:26:36.139> <DEBUG> <net.sf.ehcache.config.BeanHandler:271> -
Ignoring ehcache attribute xmlns:xsi
<oct 14 18:26:36.140> <DEBUG> <net.sf.ehcache.config.BeanHandler:271> -
Ignoring ehcache attribute xsi:noNamespaceSchemaLocation
<oct 14 18:26:36.194> <DEBUG> <net.sf.ehcache.util.PropertyUtil:88> -
propertiesString is null.
<oct 14 18:26:36.199> <DEBUG> <net.sf.ehcache.CacheManager:605> - No disk store
path defined. Skipping disk store path conflict test.
<oct 14 18:26:36.200> <DEBUG> <net.sf.ehcache.config.ConfigurationHelper:184> -
No CacheManagerEventListenerFactory class specified. Skipping...
<oct 14 18:26:36.248> <DEBUG> <net.sf.ehcache.Cache:949> - No
BootstrapCacheLoaderFactory class specified. Skipping...
<oct 14 18:26:36.248> <DEBUG> <net.sf.ehcache.Cache:923> - CacheWriter factory
not configured. Skipping...
<oct 14 18:26:36.257> <DEBUG> <net.sf.ehcache.config.ConfigurationHelper:96> -
No CacheExceptionHandlerFactory class specified. Skipping...
<oct 14 18:26:36.262> <DEBUG> <net.sf.ehcache.Cache:949> - No
BootstrapCacheLoaderFactory class specified. Skipping...
<oct 14 18:26:36.262> <DEBUG> <net.sf.ehcache.Cache:923> - CacheWriter factory
not configured. Skipping...
<oct 14 18:26:36.262> <DEBUG> <net.sf.ehcache.config.ConfigurationHelper:96> -
No CacheExceptionHandlerFactory class specified. Skipping...
<oct 14 18:26:36.290> <DEBUG> <net.sf.ehcache.Cache:1183> - Initialised cache:
commodityCache
<oct 14 18:26:36.290> <DEBUG> <net.sf.ehcache.config.ConfigurationHelper:331> -
CacheDecoratorFactory not configured. Skipping for 'commodityCache'.
<oct 14 18:26:36.291> <DEBUG> <net.sf.ehcache.config.ConfigurationHelper:360> -
CacheDecoratorFactory not configured for defaultCache. Skipping for
'commodityCache'.
What version of the product are you using? On what operating system?
1.2 at windows 7
Please provide any additional information below.
I can provide pom.xml info or whatever else if needed
Is there any way to check out why the interceptor it is not being called?
Original issue reported on code.google.com by [email protected] on 14 Oct 2011 at 9:49
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 14 Oct 2011 at 9:49The text was updated successfully, but these errors were encountered: