onmouseover / simple-spring-memcached Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/simple-spring-memcached
License: MIT License
Automatically exported from code.google.com/p/simple-spring-memcached
License: MIT License
What steps will reproduce the problem?
1. Follow the integration steps detailed here
http://code.google.com/p/simple-spring-memcached/ with a spring mvc web
application configured to use jackson 1.7.1. Just the configuration steps are
required, not the annotation.
2. Build an deploy to tomcat3.
What is the expected output? What do you see instead?
Expected output is nothing in addition to the standard output from tomcat
during deployment.
Actual output contains...
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'defaultMemcachedClient' defined in file
[C:\dev\ffiq-portal\FieldForceIQ\target\FieldForceIQ\WEB-INF\classes\META-INF\sp
ring\applicationContext.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [com.google.code.ssm.CacheFactory]: Constructor threw exception;
nested exception is java.lang.NoSuchFieldError: REQUIRE_SETTERS_FOR_GETTERS
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:767)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:698)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:519)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:319)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:185)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:833)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 108 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [com.google.code.ssm.CacheFactory]: Constructor threw
exception; nested exception is java.lang.NoSuchFieldError:
REQUIRE_SETTERS_FOR_GETTERS
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
... 118 more
Caused by: java.lang.NoSuchFieldError: REQUIRE_SETTERS_FOR_GETTERS
at com.google.code.ssm.mapper.JsonObjectMapper.<init>(JsonObjectMapper.java:50)
at com.google.code.ssm.CacheFactory.<init>(CacheFactory.java:89)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
... 120 more
This causes a bean creation exception further up the chain.
What version of the product are you using? On what operating system?
Spring framework 3.1.1.RELEASE
Jackson 1.71
Tomcat 7.0.27
JDK/JRE 7
Windows 7
Please provide any additional information below.
Changing the version of jackson from 1.7.1 to 1.9.10 resolved the issue for us.
Regards,
Mark
Original issue reported on code.google.com by [email protected]
on 5 Dec 2012 at 5:55
Is it possible to update jackson to latest version?
Original issue reported on code.google.com by [email protected]
on 4 Feb 2014 at 1:22
It would be nice to have java based configuration like
"org.springframework.cache.annotation.EnableCaching".
Original issue reported on code.google.com by [email protected]
on 22 Jan 2014 at 1:22
It seems that current Json support has a bug. Serializers are not called. I
have modified com.google.code.ssm.transcoders.JsonTranscoderTest.
https://gist.github.com/cemo/46f1dfa9176a5a78c070
Could you check these tests?
By the way, If you will already upgrade jackson It might be not necessary to
fix this issue.
Original issue reported on code.google.com by [email protected]
on 5 Feb 2014 at 2:02
It would be helpful if the dependencies in maven for things like Spring and
spymemcache were marked as provided. Otherwise a lot of exclusions are
required. This should help make the library even more of a "drop-in" solution.
Thanks!
Original issue reported on code.google.com by [email protected]
on 12 Jun 2013 at 9:41
Available memcached providers: xmemcached and spymemcached should be moved to
separated modules (artifact): ssm-xmemcached-provider and
ssm-spymemcached-provider.
Currently using ssm with xmemcached requires two dependencies:
<dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>simple-spring-memcached</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.xmemcached</groupId>
<artifactId>xmemcached</artifactId>
<version>1.3.5</version>
</dependency>
after changes only one dependency will be required:
<dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>ssm-xmemcached-provider</artifactId>
<version>2.1.0</version>
</dependency>
Original issue reported on code.google.com by [email protected]
on 19 Apr 2012 at 6:31
With simple-spring-memcached and spymemcached backend, tomcat (7.0.27) shutdown
timeouts. Error logs indicates that MemcacheClient thread cannot be stopped.
I see that net.spy.memcached.MemcachedClient implements a shutdown method, but
it is not called during the shutdown process.
If I extend CacheFactory with a destroy method (that call cache.shutdown()) and
implements DisposableBean, then the MemcachedClient.shutdown() method is called
and tomcat can stop.
Should this issue be fixed in simple-spring-memcached ?
Original issue reported on code.google.com by [email protected]
on 6 Aug 2012 at 2:13
The cache advice currently runs after the @Transactional one, which means a
transaction (and a DB hit) always occurs regardless of whether the cache is hit
or not.
The order for the transactional advice can be set in the application context
XML file like so:
<tx:annotation-driven order="2000" />
It would be nice to be able to do something similar to the Ehcache Spring
annotation project (http://code.google.com/p/ehcache-spring-annotations/) where
you can set the order like:
<ehcache:annotation-driven cache-manager="ehCacheManager" order="1000" />
This would also help the memcached advice play nicely with other advices
(loggers, profilers, etc.).
Thanks!
Original issue reported on code.google.com by [email protected]
on 27 Sep 2012 at 7:09
add connect timeout for
com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl
The xmemcached client support connect timeout
but SSM have no way to configurate this
Original issue reported on code.google.com by [email protected]
on 23 Jun 2013 at 2:41
What steps will reproduce the problem?
1. Using @ReturnValueKeyProvider for an @UpdateSingleCache annotated method
having other parameters.
2. The cache key generation fails with exception InvalidParameterException("Ids
for objects in the cache must be at least 1 character long.")
3. Updates nothing in the cache as key generation failed.
What is the expected output? What do you see instead?
Should generate key for the Object annotated by @ReturnValueKeyProvider and
accept @CacheKeyMethod as key method inside return object.
What version of the product are you using? On what operating system?
version 3.1.0
Please provide any additional information below.
As @ReturnValueKeyProvider is provided it should not always expect
@ParameterValueKeyProvider and proceed key generation using the return object.
It restricts users to provide mandatory ParameterValueKeyProvider which is not
always desired.
It is a logical bug, in CacheKeyBuilderImpl and/or AnnotationDataBuilder.
the later sets returnKeyIndex as true and do not process any
ParameterValueKeyProvider, but cache key generator expects a parameter key.
I fixed this issue.., let me know if I need to update code for verification.
Original issue reported on code.google.com by [email protected]
on 26 Mar 2013 at 4:06
It would be nice to configure MemcacheClientFactoryImpl to support
MetricCollector.
Thanks
Original issue reported on code.google.com by [email protected]
on 13 Feb 2014 at 8:30
Hi,
I am trying to use this in one of my project and I am trying to create key
tablename_key so that I will have different keys for different tables.
I want to clear cache for all keys with a prefix of tablename.
I know that memmcached doesn't know about the table names/prefixes.
I have read in the forums that there is a concept of names spaces.
Example cache.put(table1_key1, obj);
cache.put(table1_key2, obj2);
cache.put(table1_key3,obj3);
i want to do cache.clear("table1");
Thanks
Harshi
Original issue reported on code.google.com by [email protected]
on 1 May 2013 at 3:12
When I use maven plug-in Jetty 7.6.8.v20121106,it is a error
Caused by:
java.lang.IncompatibleClassChangeError: Implementing class
But when I use tomcat 7 it is OK.
I use vertion 3.2.1 simple-spring-memcached
Below is stacktrace:
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'cacheManager' defined in ServletContext resource
[/WEB-INF/classes/config/applicationContext-intmemcached.xml]: Cannot create
inner bean 'com.google.code.ssm.spring.SSMCache#1648062a' of type
[com.google.code.ssm.spring.SSMCache] while setting bean property 'caches' with
key [0]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'com.google.code.ssm.spring.SSMCache#1648062a' defined in
ServletContext resource
[/WEB-INF/classes/config/applicationContext-intmemcached.xml]: Cannot resolve
reference to bean 'defaultCache' while setting constructor argument; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'defaultCache' defined in ServletContext resource
[/WEB-INF/classes/config/applicationContext-intmemcached.xml]: Initialization
of bean failed; nested exception is java.lang.IncompatibleClassChangeError:
Implementing class
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedSet(BeanDefinitionValueResolver.java:365)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor.getAdvice(AbstractBeanFactoryPointcutAdvisor.java:85)
at org.springframework.aop.framework.Cglib2AopProxy$ProxyCallbackFilter.hashCode(Cglib2AopProxy.java:907)
at net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72.hashCode(<generated>)
at net.sf.cglib.core.DefaultNamingPolicy.getClassName(DefaultNamingPolicy.java:39)
at net.sf.cglib.core.AbstractClassGenerator.getClassName(AbstractClassGenerator.java:72)
at net.sf.cglib.core.AbstractClassGenerator.getClassName(AbstractClassGenerator.java:66)
at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:474)
at net.sf.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:201)
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:476)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:551)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:551)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:551)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:740)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:238)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1238)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:683)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:480)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:275)
at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:521)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'com.google.code.ssm.spring.SSMCache#1648062a' defined in
ServletContext resource
[/WEB-INF/classes/config/applicationContext-intmemcached.xml]: Cannot resolve
reference to bean 'defaultCache' while setting constructor argument; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'defaultCache' defined in ServletContext resource
[/WEB-INF/classes/config/applicationContext-intmemcached.xml]: Initialization
of bean failed; nested exception is java.lang.IncompatibleClassChangeError:
Implementing class
Original issue reported on code.google.com by [email protected]
on 24 Oct 2013 at 1:12
I am using 3rd party client domain objects which are restricted to modification. What I would like to is a mechanism to convert serialized objects to another one. Let me to give you an example:
@CacheValueMethod(convertor="VideoConvertor")
@Cacheable(value = "defaultCache#600", key = "'cemo'")
@Override
public VideoInfo getVideoByTagId(List<Long> params) {
return videoDAO.getVideoByTagId(params);
}
Here I would like to store videoId instead of VideoInfo. A convertor might be a
bean as well. Guava project has a similar converter [1].
[1]: com.google.common.base.Converter
Original issue reported on code.google.com by [email protected]
on 23 Jan 2014 at 9:37
It would be beneficial if SSM supported Guice as an alternative to Spring. The
dependency injector library should be an add-on.
The primary challenge appears to be the use of AspectJ advices instead of
AOPAlliance's method interceptors. There is probably an adapter scheme, as
Spring supports both, so that Guice's AOPAlliance support can be leveraged. I
haven't figured out that detail, though.
Original issue reported on code.google.com by [email protected]
on 29 Jun 2013 at 7:34
When A is a superclass of B, and A has an annotated method @CacheKeyMethod,
then this method is ignored for B instance (and to toString() is used in place).
If I override the annotated method in B, and add the annotation, expected
behavior is used.
It may be more appropriate that @CacheKeyMethod of superclasses is used when no
@CacheKeyMethod is found in an object instance ? If not, @CacheKeyMethod
javadoc may be modified to expose this behavior ?
Original issue reported on code.google.com by [email protected]
on 12 Sep 2012 at 12:49
There is a default log4j.properties inside simple-spring-memcached-3.0.0.jar
deployed maven artifact.
It can be problematic in project that provide log4j configuration inside a jar,
because project configuration can be overriden by this file.
May this file be deleted from the deployed artifact ?
Original issue reported on code.google.com by [email protected]
on 31 Jul 2012 at 8:55
What steps will reproduce the problem?
Try to specify the weights of the servers (see
https://code.google.com/p/xmemcached/wiki/Spring_Integration)
What is the expected output? What do you see instead?
XMemcachedClient created with weights, not possible to specify them in
What version of the product are you using? On what operating system?
3.2.1
Please provide any additional information below.
My hack to get weights to work is to rewrite the factory and check the config
before initializing the XMemcachedBuilder (since as you pointed out, there is
no getter/setter for weights).
Something like:
int[] weights = null;
if (conf instanceof XMemcachedConfiguration) {
weights = ((XMemcachedConfiguration) conf).getConvertedWeights();
}
MemcachedClientBuilder builder = new XMemcachedClientBuilder(addrs, weights);
I allowed the weights to be passed as a comma separated list of integers, and
getConvertedWeights converts the comma separated list into an int[] (if the
string is null or empty null is returned).
Original issue reported on code.google.com by [email protected]
on 4 Dec 2013 at 4:46
For testing purpose I wanted to use the cache without having to use annotation.
Is there any particular reason why I couldn't do the following?
public class CachingServiceTest {
@Autowired
com.google.code.ssm.CacheFactory cacheFactory;
@Test
public void testGetCache() throws Exception {
Cache result = cachingService.getCache();
assertNotNull(result);
}
}
If i run the above unit test I run into "This factory has already created
memcached client" error.
Maybe I misunderstand how to do something similar to the above but it would be
really nice to be able to do manipulation and checking of the cache without
having to use annotations.
Original issue reported on code.google.com by [email protected]
on 19 Jun 2012 at 7:23
Hi,
We are using ReadThroughMultiCacheAdvice and if the results are partially in
the cache, the output of the method isn't sorted correctly as it doesn't
respect the order of the keys passed in argument.
The problem is in generateByKeysFromResult and generateByKeysProviders: the
results should be sorted using the keys order in these methods.
Did we miss something or do you agree there is a bug here?
Thanks for your feedback.
--
Guillaume
Original issue reported on code.google.com by [email protected]
on 28 Nov 2013 at 2:11
spring-cache does not support cache aliases(cache zones).
spring-cache SSMCache generate cache key without any information about cache
zones. So I had to add prefix for all the keys.
Because of that I add cacheAliases and a key generator support for spring-cache.
For example when you have the following settings,
<bean name="cacheManager" class="com.google.code.ssm.spring.SSMCacheManager">
<property name="caches">
<set>
<bean class="com.google.code.ssm.spring.SSMCache">
<constructor-arg name="cache" index="0" ref="userCache" />
<constructor-arg name="expiration" index="1" value="300" />
<constructor-arg name="allowClear" index="2" value="false" />
</bean>
</set>
</property>
</bean>
<bean name="userCache" class="com.google.code.ssm.CacheFactory">
<property name="cacheName" value="userCache" />
.....
<property name="cacheAliases">
<set>
<value>userAliasCache1</value>
<value>userAliasCache2</value>
</set>
</property>
</bean>
You can use, userCache, userAliasCache1, userAliasCache2 as
@Cacheable#value,@CachePut#value, @CacheEvict#value, ....
When you have the following method and both entity.id and secondEneity.id have
the same value(ex, 1).
@Cacheable(value="userCache", key="#entity.id")
public Entity get() { .. }
@Cacheable(value="userAliasCache1", key="#secondEntity.id")
public SecondEntity get() { .. }
memcached will have "userCache::1" and "userAliasCache1::1" keys.
Of course you can change generated key formats with
com.google.code.ssm.spring.SSMKeyGenerator implmentations.
Original issue reported on code.google.com by [email protected]
on 3 Oct 2013 at 1:41
Attachments:
What steps will reproduce the problem?
--------------------------------------
1. Use the Spy client, configured with a short (but not completely
unreasonable) timeout value of 50ms.
2. Clear the cache.
3. Make a request through a method annotated with ReadThroughMultiCache, asking
for a largish number of objects by ID (200 in my case). Relevant method
annotation:
@ReadThroughMultiCache(
namespace = "UserSvc/users",
expiration = 3600,
option = @ReadThroughMultiCacheOption(generateKeysFromResult=true, addNullsToCache = true, skipNullsInResult = true))
public List<User> getObjectsByIds(@ParameterValueKeyProvider List<String> objectIds) {...}
What is the expected output? What do you see instead?
------------------------------------------------------
When the underlying method returns all 200 objects, I would expect the SSM
results to match the results of the annotated method. However, if the memcache
client throws a CheckedOperationTimeoutException, only some of the results are
returned. The number of returned objects depends on when an error is thrown.
See additional logged details below.
What version of the product are you using? On what operating system?
--------------------------------------------------------------------
I've reproduced this issue using v-3.1.0 and v-3.2.0 (spymemcached-provider),
on both RHEL-6.4 and OSX-10.7.5. I haven't managed to catch this with a unit
test yet. I can reliably reproduce this in a multiple-machine environment
though.
Please provide any additional information below.
------------------------------------------------
What appears to be happening is that after the error is thrown, SSM calls the
annotated method a second time (with a subset of the original IDs [I assume
these are the ones not found in cache on the first attempt]). However, rather
than merging the results of the two calls, SSM appears to be returning only the
results of the second method call.
Relevant logs below
===================
# Manually clear the cache.
18:53:40.330 [pool-1-thread-3] INFO
com.dreamworks.dwadigital.management.spymemcached.MemcachedStats - Memcached
cache flush(): succeeded
# Implied:
# SSM intercepts a call to getObjectsByIds(...)
# Cache miss, so SSM calls our method with all 200 IDs.
# Our DAO is asked to look up all 200 of the objects by their ID, which it does.
18:53:45.146 [http-/127.5.78.1:8080-1] DEBUG
com.dreamworks.dwadigital.mongo.GenericDao - getObjectsByIds: request count=200
18:53:45.537 [http-/127.5.78.1:8080-1] DEBUG
com.dreamworks.dwadigital.mongo.GenericDao - getObjectsByIds: response count=200
# SSM tries to store the 200 objects into cache, but fails for some, because of
timeouts.
18:53:45.635 [http-/127.5.78.1:8080-1] WARN com.google.code.ssm.CacheImpl -
Cannot set on key UserSvc/users:518a1d9ce4b0963488cbc2e6
com.google.code.ssm.providers.CacheException:
java.util.concurrent.ExecutionException:
net.spy.memcached.internal.CheckedOperationTimeoutException: Operation timed
out. - failing node:
memcache01-dev-igo.las.virtualdreamworks.com/10.205.48.181:11211
at com.google.code.ssm.providers.spymemcached.MemcacheClientWrapper.set(MemcacheClientWrapper.java:295) ~[spymemcached-provider-3.2.0.jar:na]
at com.google.code.ssm.CacheImpl.set(CacheImpl.java:279) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.CacheImpl.set(CacheImpl.java:120) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.CacheImpl.setSilently(CacheImpl.java:136) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.aop.ReadThroughMultiCacheAdvice.generateByKeysFromResult(ReadThroughMultiCacheAdvice.java:149) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.aop.ReadThroughMultiCacheAdvice.cacheMulti(ReadThroughMultiCacheAdvice.java:123) ~[simple-spring-memcached-3.2.0.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at com.dreamworks.dwadigital.user.persistence.UserCachingDao$$EnhancerByCGLIB$$d3743a80.getObjectsByIds(<generated>) ~[spring-core-3.2.0.RELEASE.jar:na]
[snip]
# Same error as above, but different cache key
18:53:45.834 [http-/127.5.78.1:8080-1] WARN com.google.code.ssm.CacheImpl -
Cannot set on key UserSvc/users:518be9dfe4b02ee6e55a5e25
[snip]
# Same error as above, but different cache key
18:53:45.936 [http-/127.5.78.1:8080-1] WARN com.google.code.ssm.CacheImpl -
Cannot set on key UserSvc/users:518d37e9e4b0f21cc2e8d2dd
[snip]
# SSM sees that not all objects were successfully pulled from cache, so it
calls the annotated method again.
18:53:46.031 [http-/127.5.78.1:8080-1] WARN
com.google.code.ssm.aop.ReadThroughMultiCacheAdvice - Caching on
execution(UserCachingDao.getObjectsByIds(..)) aborted due to an error. The
underlying method will be called twice.
java.lang.RuntimeException: Timed out waiting for operation
at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:81) ~[spymemcached-2.8.1.jar:2.8.1]
at com.google.code.ssm.providers.spymemcached.MemcacheClientWrapper.set(MemcacheClientWrapper.java:289) ~[spymemcached-provider-3.2.0.jar:na]
at com.google.code.ssm.CacheImpl.set(CacheImpl.java:279) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.CacheImpl.set(CacheImpl.java:120) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.CacheImpl.setSilently(CacheImpl.java:136) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.aop.ReadThroughMultiCacheAdvice.generateByKeysFromResult(ReadThroughMultiCacheAdvice.java:149) ~[simple-spring-memcached-3.2.0.jar:na]
at com.google.code.ssm.aop.ReadThroughMultiCacheAdvice.cacheMulti(ReadThroughMultiCacheAdvice.java:123) ~[simple-spring-memcached-3.2.0.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE]
at com.dreamworks.dwadigital.user.persistence.UserCachingDao$$EnhancerByCGLIB$$d3743a80.getObjectsByIds(<generated>) ~[spring-core-3.2.0.RELEASE.jar:na]
[snip]
at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]
Caused by: net.spy.memcached.internal.CheckedOperationTimeoutException: Timed
out waiting for operation - failing node:
memcache01-dev-igo.las.virtualdreamworks.com/10.205.48.181:11211
at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:93) ~[spymemcached-2.8.1.jar:2.8.1]
at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:79) ~[spymemcached-2.8.1.jar:2.8.1]
... 53 common frames omitted
# The annotated method gets called again. It returns all of the results it was
asked for.
18:53:46.032 [http-/127.5.78.1:8080-1] DEBUG
com.dreamworks.dwadigital.mongo.GenericDao - getObjectsByIds: request count=179
18:53:46.338 [http-/127.5.78.1:8080-1] DEBUG
com.dreamworks.dwadigital.mongo.GenericDao - getObjectsByIds: response count=179
# BUG: The caller of the cached method gets just some of the results, rather
than all of them.
18:53:46.339 [http-/127.5.78.1:8080-1] DEBUG
com.dreamworks.dwadigital.user.service.UserService - queryUsers: response
count=179
Original issue reported on code.google.com by [email protected]
on 23 Sep 2013 at 7:13
MyBatis3 no longer need to write the interface implementation class, like below
so:
public interface UserDao {
@ReadThroughSingleCache(namespace = "user", expiration = 3600)
@Select(value = "SELECT * FROM user WHERE id = #{id}")
User getUser(@ParameterValueKeyProvider Long id)
}
However, the SSM can not set the value of memcached server. How to do it?
Mac 10.8.1, Spring3.1.1, MyBatis3.1.1, SSM3.0.2
Original issue reported on code.google.com by [email protected]
on 12 Sep 2012 at 9:07
Current Spring reference states that [1] [2]:
> At a minimum you will need the following libraries to use the Spring
Framework's support for AspectJ LTW:
>spring-aop.jar (version 2.5 or later, plus all mandatory dependencies)
>aspectjweaver.jar (version 1.6.8 or later)
I have noticed that some poms have aspectjrt dependency [1].
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
Is it possible to remove aspectjrt dependency?
[1]:
http://docs.spring.io/spring/docs/3.2.6.RELEASE/spring-framework-reference/htmls
ingle/#aop
[2]: https://jira.springsource.org/browse/SPR-8896
[3]:
https://code.google.com/p/simple-spring-memcached/source/browse/trunk/simple-spr
ing-memcached/pom.xml
Original issue reported on code.google.com by [email protected]
on 19 Feb 2014 at 12:58
I'm using @ReadThroughMultiCache annotation. I found some type of sql like
below this, SSM will return a message. Then memcached is not successful cache
data.
----
com.google.code.ssm.aop.ReadThroughMultiCacheAdvice: Did not receive a
correlated amount of data from the target method.
If My Sql so below, then memcached is not successful cache data.
----
mysql> SELECT u.id, u.name, r.id as "role.id", r.name as "role.name"
-> FROM user u, user_role ur, role r
-> WHERE u.id = ur.userid and r.id = ur.roleid and ur.roleid in (1,2);
+------+-------+---------+------------+
| id | name | role.id | role.name |
+------+-------+---------+------------+
| 1000 | Tom | 1 | ROLE_ADMIN |
| 1001 | Jerry | 2 | ROLE_USER |
| 1002 | Jack | 1 | ROLE_ADMIN |
+------+-------+---------+------------+
3 rows in set (0.00 sec)
If My Sql modified so below, then memcached is successful cache data.
----
mysql> SELECT u.id, u.name, r.id as "role.id", r.name as "role.name"
-> FROM user u, user_role ur, role r
-> WHERE u.id = ur.userid and r.id = ur.roleid and ur.roleid in (1);
+------+------+---------+------------+
| id | name | role.id | role.name |
+------+------+---------+------------+
| 1000 | Tom | 1 | ROLE_ADMIN |
| 1002 | Jack | 1 | ROLE_ADMIN |
+------+------+---------+------------+
2 rows in set (0.00 sec)
If My Sql modified so below, then memcached is successful cache data.
----
mysql> SELECT u.id, u.name
-> FROM user u
-> WHERE u.id in (1000,1001,1002);
+------+-------+
| id | name |
+------+-------+
| 1000 | Tom |
| 1001 | Jerry |
| 1002 | Jack |
+------+-------+
My evn: Spring 3, Mybatis 2.3.5, SSM 3.0.2, MySQL5.5
Test Code:
https://github.com/batizhao/spring-mybatis-memcached/tree/master/ssm3-mybatis2-m
emcached
Original issue reported on code.google.com by [email protected]
on 25 Sep 2012 at 8:23
I found a problem with generics and in particular with a DAO structure like
this:
* public interface GenericDAO<T>
* public interface SpecificDAO extends GenericDAO<AppUser>
* public class SpecificDAOImpl implements SpecificDAO
I wrote a test (GenericsTest) that fails with the current code of
simple-spring-memcached.
The only solution that I found is to add a new annotation (@GenericsBridged).
I attach the classes that I modified (from simple-spring-memcached
2.0.0-SNAPSHOT).
Chiara Zambelli
Original issue reported on code.google.com by [email protected]
on 9 Jan 2012 at 10:28
Attachments:
What steps will reproduce the problem?
1.<!-- spring annotation package scan -->
<context:component-scan base-package="com.zxhz"/>
<aop:aspectj-autoproxy/>
<mvc:annotation-driven/>
<!-- memcached -->
<import resource="classpath:simplesm-context.xml" />
<bean name="defaultMemcachedClient" class="com.google.code.ssm.CacheFactory">
<property name="cacheName" value="slfV5_Cache" />
<property name="cacheClientFactory">
<bean name="cacheClientFactory" class="com.google.code.ssm.providers.spymemcached.MemcacheClientFactoryImpl" />
</property>
<property name="addressProvider">
<bean class="com.google.code.ssm.config.DefaultAddressProvider">
<property name="address" value="192.168.1.62:11211" />
</bean>
</property>
<property name="configuration">
<bean class="com.google.code.ssm.providers.CacheConfiguration">
<property name="consistentHashing" value="true" />
</bean>
</property>
</bean>
2. Junit Test
3.[2012-12-13 19:32:05 0952 WARN ] [main] ssm.aop.ReadThroughAssignCacheAdvice
- Caching on method execution(TestController.testssm()) and key [zt:zt] aborted
due to an error.
com.google.code.ssm.aop.UndefinedCacheException: The cache with name or alias
'default' is no defined
at com.google.code.ssm.aop.CacheBase.getCache(CacheBase.java:108)
at com.google.code.ssm.aop.SingleReadCacheAdvice.cache(SingleReadCacheAdvice.java:68)
at com.google.code.ssm.aop.ReadThroughAssignCacheAdvice.cacheSingleAssign(ReadThroughAssignCacheAdvice.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.zxhz.web.TestController$$EnhancerByCGLIB$$5bc484b6.testssm(<generated>)
at com.zxhz.slf.test.TestMemcachedClient.test(TestMemcachedClient.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
spring3.0.5
SSM 3.10
Memcached for windows 1.2
Original issue reported on code.google.com by [email protected]
on 13 Dec 2012 at 11:45
The API looks very powerful, but would you please also provide a Spring 3.1
Cache / CacheManager implementation, as well to make it easy to consume this
API in a consistant way from Spring 3.1 based applications?
Original issue reported on code.google.com by [email protected]
on 24 Apr 2012 at 10:47
No unique bean of type [com.google.code.ssm.Settings] is defined: expected
single bean but found 0:
Original issue reported on code.google.com by [email protected]
on 15 Apr 2014 at 4:22
CacheKeyMethod can only be set on one method of the object. if you want the key
constructed from a few fields you have to write your own method to build the
key.
so adding ability to set CacheKeyMethod on more then one method and maybe add
an order parameter.
also the return must be string which is limiting , can just use the toString of
return values.
IMP using CacheKeyMethod in some cases is bad design, to add cache knowledge
and specific methods to classes. in my case the objects are hibernate entities
and I don't want to fill them with cache knowledge and to couple them with SSM.
could add a keyGeneratorClass parameter to all ReadThrough* annotations and
invoke it with the annotation data and method data to generate the key.
Original issue reported on code.google.com by [email protected]
on 18 Mar 2013 at 2:35
This is a complementary issue to #25
> I don't think that we should modify behavior of Cacheable annotation because
it's not a part of SSM but Spring. > If you want such feature you should
request it from Spring team then SSM will support it out of the box.
> In raw SSM there is a workaround. You can use SerializationType.CUSTOM and
register custom cache transcoder > using CacheFactory. In the transcoder you
can define how to serialize and deserialize objects of given type.
I started to use SerializationType.CUSTOM but I have encountered some problems.
But before I would like to summarise my use case: I had an inmemory entity map
and want to use cache for complicated queries. But instead of persisting all
entities in cache I would like to store only id's in map. Here is signature of
one of my service method.
List<VideoInfo> getWeeklyMostPopularVideosByCategoryId(Long categoryId, Boolean homePageAndSearchRestricted, Integer limit);
I would like to store List<Integer> in my cache instead of List<VideoInfo>. I
am already using an inmemory store and this way I will reduce the serialization
cost of my entities.
Here is the questions:
1. com.google.code.ssm.spring.SSMCache#put is calling null SerializationType.
Is this expected? I was expecting to a resolving strategy for SerializationType.
2. My entities are in 3rd party clients. I can not modify them. (I also think
that not polluting entities by library annotations such as Json annotation, JPA
or Cache is a good practice.) Is there a way to register each entity by
CacheFactory like this:
CacheFactory.registerSerializationType(MyEntity.class,
SerializationType.CUSTOM);
3. How can I provide custom serialization for Collection<MyEntity> types. What
I would like to do is using provided serialization for Collection types but
custom serialization for my entities.
Thanks
Original issue reported on code.google.com by [email protected]
on 3 Feb 2014 at 2:58
Code:
----
public interface RoleDao {
List getRoles();
}
@Repository
public class RoleDaoImpl implements RoleDao {
@Override
@ReadThroughMultiCache(namespace = "role/list", expiration = 60)
public List<Role> getRoles() {
return sqlMapClientTemplate.queryForList("getRoles");
}
}
Result:
----
WARN 2012-09-21 15:04:07,374 com.google.code.ssm.aop.CacheAdvice: Caching on
execution(RoleDao.getRoles()) aborted due to an error.
java.security.InvalidParameterException: No KeyProvider annotation found method
[getRoles]
Question:
----
Why must use the parameter as a key? Can I use other hash strategy?
Original issue reported on code.google.com by [email protected]
on 21 Sep 2012 at 7:11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.