[問題] elastic beanstalk + dynamodb(已解決)

看板Cloud作者 (亨堡)時間8年前 (2016/08/01 18:09), 8年前編輯推噓1(105)
留言6則, 2人參與, 最新討論串1/1
各位前輩好~ 小弟專案是JAVA MAVEN,想使用Elatic Beanstalk 環境是Tomcat7+Java7 然後把session存在DynamoDB 避免 auto scalable的時候session遺失 在網路上找了很多範例 幾乎每個都不太相同 我用了這個範例 先做測試 https://goo.gl/YimfDT 1.建立了一個 .ebextensions資料夾 在WEB-INF下面 2.放入 AmazonDynamoDBSessionManagerForTomcat-1.0.1.jar context.xml 00-tomcat-setup.config 3.上傳部署到Elastic Beanstalk上面 4.日誌出現錯誤 [2016-08-01T10:08:32.003Z] INFO [24618] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity... ------------------------------------- /var/log/httpd/elasticbeanstalk-error_log ------------------------------------- ------------------------------------- /var/log/tomcat7/catalina.out ------------------------------------- at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:144) at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282) ... 31 more Aug 01, 2016 9:26:14 AM org.apache.catalina.startup.ContextConfig processContextConfig SEVERE: Occurred at line 7 column 40 Aug 01, 2016 9:26:15 AM org.apache.tomcat.util.scan.StandardJarScanner scan WARNING: Failed to scan [file:/usr/share/java/tomcat7/aws-dynamodb-session-tomcat-2.0.1.jar] from classloader hierarchy java.util.zip.ZipException: invalid CEN header (bad signature) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:215) at java.util.zip.ZipFile.<init>(ZipFile.java:145) at java.util.jar.JarFile.<init>(JarFile.java:154) at java.util.jar.JarFile.<init>(JarFile.java:91) at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93) at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69) at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99) at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) at org.apache.tomcat.util.scan.FileUrlJar.<init>(FileUrlJar.java:41) at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:34) at org.apache.catalina.startup.ContextConfig$FragmentJarScannerCallback.scan(ContextConfig.java:2679) at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:259) at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:221) at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1915) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:887) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:387) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Aug 01, 2016 9:26:15 AM org.apache.catalina.startup.ContextConfig configureStart SEVERE: Marking this application unavailable due to previous error(s) Aug 01, 2016 9:26:16 AM org.apache.catalina.startup.TldConfig tldScanJar WARNING: Failed to process JAR [jar:file:/usr/share/java/tomcat7/aws-dynamodb-session-tomcat-2.0.1.jar!/] for TLD files java.util.zip.ZipException: invalid CEN header (bad signature) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:215) at java.util.zip.ZipFile.<init>(ZipFile.java:145) at java.util.jar.JarFile.<init>(JarFile.java:154) at java.util.jar.JarFile.<init>(JarFile.java:91) at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93) at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69) at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99) at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) at org.apache.tomcat.util.scan.FileUrlJar.<init>(FileUrlJar.java:41) at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:34) at org.apache.catalina.startup.TldConfig.tldScanJar(TldConfig.java:502) at org.apache.catalina.startup.TldConfig.access$200(TldConfig.java:61) at org.apache.catalina.startup.TldConfig$TldJarScannerCallback.scan(TldConfig.java:300) at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:259) at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:221) at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:271) at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:590) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 請問各位前輩,這是甚麼問題呢? 可以怎麼解決呢? 謝謝 -- - ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.124.69.34 ※ 文章網址: https://www.ptt.cc/bbs/Cloud/M.1470046186.A.31A.html ※ 編輯: a6091731 (59.124.69.34), 08/01/2016 18:58:54 ※ 編輯: a6091731 (59.124.69.34), 08/01/2016 19:00:42

08/01 19:57, , 1F
08/01 19:57, 1F

08/03 07:56, , 2F
我覺得你可以去臉書搜尋AWS台灣的社群 再到那發問 還有
08/03 07:56, 2F

08/03 07:56, , 3F
這問題感覺跟java比較相關
08/03 07:56, 3F

08/03 18:02, , 4F
已經有在AWS問,我覺得問題應該會偏向linux上部署Tomcat
08/03 18:02, 4F

08/03 18:03, , 5F
去覆寫context.xml和加入lib的時候出問題,只是剛好使用
08/03 18:03, 5F

08/03 18:03, , 6F
AWS的Elastic+dynamodb 所以想上來看看有沒有人碰過
08/03 18:03, 6F
文章代碼(AID): #1Ndn_gCQ (Cloud)
文章代碼(AID): #1Ndn_gCQ (Cloud)