AWS Elastic Beanstalk Tomcat使用.war但不使用.zip [英] AWS Elastic Beanstalk Tomcat works with .war but not .zip

查看:89
本文介绍了AWS Elastic Beanstalk Tomcat使用.war但不使用.zip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用弹性beantalk和tomcat将应用程序部署到EC2。为了尝试解决其他问题,我将上载的文件从.war更改为.zip,以包括.ebextensions文件夹。但是,现在尝试进入网站时出现以下错误:

I am trying to deploy an application to EC2 with elastic beanstalk and tomcat. In order to try and fix a different problem I had I changed my uploaded file from a .war to a .zip in order to include a .ebextensions folder. However, now I get the following error when trying to enter the website:

我发现添加的.config文件可能存在问题,因此我尝试单独压缩.war文件,但是我得到了完全相同的错误,因此可以排除。

I figured that there might be a problem with the .config file I added, so I tried zipping the .war file alone, however I get the exact same error, so this is ruled out.

推荐答案

TL / DR:将2个.war文件放在.zip文件中,而不是1个。

TL/DR: Put 2 .war files in the .zip file instead of 1.

我知道这个帖子已经快18个月了。但是我经历了完全相同的症状,因此这似乎是分享我的发现的好地方。

I realize this post is nearly 18 months old. But I experienced exactly the same symptoms, so this seemed as good a place as any to share my discovery.

前提:部署.war文件的效果很好,完全符合预期

Premise: deploying a .war file works well, exactly as expected.

观察:Elastic Beanstalk自动执行此操作:

Observation: Elastic Beanstalk does this automatically:

/usr/share/tomcat/webapps/ROOT/[contents of .war are placed here]

问题:部署包含此.war文件和有效配置文件的.zip文件无法正常工作。

Problem: deploying a .zip file containing this .war file along with valid config files does NOT work well.

观察:Elastic Beanstalk自动执行此操作:

Observation: Elastic Beanstalk does this automatically:

/usr/share/tomcat/webapps/ROOT/[my-war.war is placed here]

对我来说似乎是个错误。也许是故意的行为...但是我不明白。将.war文件放在webapps中将很有意义。将.war的 contents 放在ROOT中会很有意义。但是直接将.war文件放在那里似乎很奇怪。

To me this seems like a bug. Perhaps it's intended behavior... but I don't understand it. Placing the .war file in webapps would make sense. Placing the contents of the .war in ROOT would make sense. But placing the .war file there directly seems very strange.

解决方案:将第二个.war文件添加到.zip中(即使您不需要第二个应用程序!)。

Solution: Add a second .war file to the .zip (even if you don't need the second app!).

观察:Elastic Beanstalk自动执行此操作:

Observation: Elastic Beanstalk does this automatically:

/usr/share/tomcat/webapps/[my-war.war is placed here]
/usr/share/tomcat/webapps/[my-other-war.war is placed here]

现在my-war.war可以正常部署,生活也很好。

Now my-war.war deploys normally, and life is good.

这篇关于AWS Elastic Beanstalk Tomcat使用.war但不使用.zip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆