Java 弹簧靴

Java 弹簧靴,java,amazon-web-services,spring-boot,amazon-elasticache,Java,Amazon Web Services,Spring Boot,Amazon Elasticache,我使用SpringBoot注释来使用AWS弹性验证。 在我的应用程序配置中,我有: @EnableAutoConfiguration(exclude = {ElastiCacheAutoConfiguration.class}) @EnableElastiCache({@CacheClusterConfig(name = "mycache", expiration = 23)}) 在我的服务中,我有: @Cacheable(value = "mycache", key = "#key") 我

我使用SpringBoot注释来使用AWS弹性验证。 在我的应用程序配置中,我有:

@EnableAutoConfiguration(exclude = {ElastiCacheAutoConfiguration.class})
@EnableElastiCache({@CacheClusterConfig(name = "mycache", expiration = 23)})
在我的服务中,我有:

@Cacheable(value = "mycache", key = "#key")
我尝试在application-dev.properties中添加属性:

spring.cache.type=NONE
一切正常,但当我尝试在本地调试时,我的应用程序尝试连接到Amazon ElastiCache,并出现一些连接错误:

java.lang.IllegalStateException: Client is not initialized
at net.spy.memcached.MemcachedClient.checkState(MemcachedClient.java:1623) ~[elasticache-java-cluster-client-1.0.61.0.jar:na]
at net.spy.memcached.MemcachedClient.enqueueOperation(MemcachedClient.java:1617) ~[elasticache-java-cluster-client-1.0.61.0.jar:na]
at net.spy.memcached.MemcachedClient.asyncGet(MemcachedClient.java:1013) ~[elasticache-java-cluster-client-1.0.61.0.jar:na]
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1235) ~[elasticache-java-cluster-client-1.0.61.0.jar:na]
at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1256) ~[elasticache-java-cluster-client-1.0.61.0.jar:na]
at org.springframework.cloud.aws.cache.memcached.SimpleSpringMemcached.get(SimpleSpringMemcached.java:56) ~[spring-cloud-aws-context-1.0.3.RELEASE.jar:1.0.3.RELEASE]
at org.springframework.cache.interceptor.AbstractCacheInvoker.doGet(AbstractCacheInvoker.java:68) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.cache.interceptor.CacheAspectSupport.findInCaches(CacheAspectSupport.java:466) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem(CacheAspectSupport.java:432) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:336) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:302) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at com.example.ExpensiveService$$EnhancerBySpringCGLIB$$e10c10a8.calculateExpensiveValue(<generated>) ~[classes/:na]
at com.example.CacheController.getLookupObjectByName(CacheController.java:24) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:261) ~[spring-boot-actuator-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:115) ~[spring-boot-actuator-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103) ~[spring-boot-actuator-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458) [tomcat-embed-core-8.0.33.jar:8.0.33]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.33.jar:8.0.33]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
java.lang.IllegalStateException:客户端未初始化
在net.spy.memcached.MemcachedClient.checkState(MemcachedClient.java:1623)~[elasticache-java-cluster-client-1.0.61.0.jar:na]
在net.spy.memcached.MemcachedClient.enqueueOperation(MemcachedClient.java:1617)~[elasticache-java-cluster-client-1.0.61.0.jar:na]
在net.spy.memcached.MemcachedClient.asyncGet(MemcachedClient.java:1013)~[elasticache-java-cluster-client-1.0.61.0.jar:na]
在net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1235)~[elasticache-java-cluster-client-1.0.61.0.jar:na]
在net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1256)~[elasticache-java-cluster-client-1.0.61.0.jar:na]
在org.springframework.cloud.aws.cache.memcached.SimpleSpringMemcached.get(SimpleSpringMemcached.java:56)~[spring-cloud-aws-context-1.0.3.RELEASE.jar:1.0.3.RELEASE]
在org.springframework.cache.interceptor.AbstractCacheInvoker.doGet(AbstractCacheInvoker.java:68)~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.cache.interceptor.CacheAspectSupport.findInCaches(CacheAspectSupport.java:466)~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem(CacheAspectSupport.java:432)~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:336)~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:302)~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.aop.framework.ReflectiveMethodInvocation.procedue(ReflectiveMethodInvocation.java:179)~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在com.example.ExpensiveService$$EnhancerBySpringCGLIB$$e10c10a8.calculateExpensiveValue()~[classes/:na]
在com.example.CacheController.getLookupObjectByName(CacheController.java:24)~[classes/:na]
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)~[na:1.8.0\u 91]
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)~[na:1.8.091]
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)~[na:1.8.091]
在java.lang.reflect.Method.invoke(Method.java:498)~[na:1.8.091]
在org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.mvc.method.annotation.ServletinInvocableHandlerMethod.invokeAndHandle(ServletinInvocableHandlerMethod.java:110)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在javax.servlet.http.HttpServlet.service(HttpServlet.java:622)~[tomcat-embed-core-8.0.33.jar:8.0.33]
在org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在javax.servlet.http.HttpServlet.service(HttpServlet.java:729)~[tomcat-embed-core-8.0.33.jar:8.0.33]
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)~[tomcat-embed-core-8.0.33.jar:8.0.33]
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)~[tomcat-embed-core-8.0.33.jar:8.0.33]
在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)~[tomcat-embed-websocket-8.0.33.jar:8.0.33]
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)~[tomcat-embed-core-8.0.33.jar:8.0.33]
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)~[tomcat-embed-core-8.0.33.jar:8.0.33]
在org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:261)~[spring-boot-actuator-1.3.5.RELEASE.jar:1.3.5.RELEASE]
在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
在org.apache.catalina.core.applicationFilt上