因为我希望能够在我的Grails 3应用程序的多个实例中保持http会话(在Elastic Beanstalk中运行),我希望使用DynamoDb,如上所述HERE
(基本上在WEB-INF中提供了一个特殊的dynamodb jar,一个上下文文件和一个.config文件,其中包含aws将这两个文件复制到aws上的本地tomcat实例的指令)
在aws安全密钥等问题出现之后,我终于得到了我的grails应用程序,以便在Amazon Elastic Beanstalk上成功部署和启动。但是,当我在会话中保存一些内容时,我在AWS的DyanmoDb面板中看不到任何内容。查看日志后,我看到以下内容:
连接清理线程 - 但未能阻止它。这很可能造成内存泄漏。堆栈线程跟踪:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
28-Jan-2016 20:47:54.595 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [java-sdk- http-connection-reaper] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
com.amazonaws.tomcatsessionmanager.amazonaws.http.IdleConnectionReaper.run(IdleConnectionReaper.java:112)
28-Jan-2016 20:47:54.596 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [dynamo-session-manager-expired-sesion-reaper] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)**
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
28-Jan-2016 20:47:54.597 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [
想知道是否有人有任何想法我如何解决这个问题。我希望,一旦我有了动态支持httpsession,我可以尽可能多地启动我的网络应用程序,并且仍然可以在不同的服务器上运行用户会话而不依赖于“粘性”会话等。