简体   繁体   English

如何通过部署War从Tomcat本地运行多个从属应用程序?

[英]How to Run multiple dependent applications from Tomcat locally by deploying their war?

I have 4 war files of 4 Grails and Java applications which I want to deploy on Apache Tomcat 9 locally. 我有4个Grails和Java应用程序的4个war文件,我想在本地将它们部署在Apache Tomcat 9上。 If one of these applications need to run first and then others, how should I deploy them? 如果其中一个应用程序需要先运行,然后再运行其他应用程序,我应该如何部署它们? Currently I have created 4 folders in tomcat directory and pasted the respective wars. 目前,我在tomcat目录中创建了4个文件夹,并粘贴了相应的war。 When I start tomcat it picks up all one by one to deploy but I don't know if it should pick them up in sequence for proper deployment because I am getting errors in log. 当我启动tomcat时,它会逐个拾取所有要部署的文件,但是我不知道是否应该按顺序拾取它们以进行正确的部署,因为我在日志中遇到错误。 How should I deploy them? 我应该如何部署它们?

SEVERE [localhost-startStop-1] 

org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; org.apache.catalina.core.StandardContext.listenerStart异常将上下文初始化事件发送到类org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener org.springframework.beans.factory.BeanCreationException的侦听器实例:创建名称为'的bean时出错在ServletContext资源[/WEB-INF/applicationContext.xml]中定义的pluginManager':调用init方法失败; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object 嵌套异常是java.lang.NullPointerException:无法在空对象上调用方法getAt()

Another in log 另一个日志

[localhost-startStop-1] 

org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. org.apache.catalina.core.StandardContext.startInternal一个或多个侦听器无法启动。 Full details will be found in the appropriate container log file 03-Jan-2017 01:11:04.950 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/(app name)] startup failed due to previous errors 完整的详细信息将在相应的容器日志文件中找到03-Jan-2017 01:11:04.950 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/(app name)]启动失败由于先前的错误

A DevOps approach using Jenkins might solve your issue. 使用Jenkins的DevOps方法可能会解决您的问题。

You can build and/or deploy your applications in a prescribed order with FreeStyle jobs. 您可以使用FreeStyle作业以指定的顺序构建和/或部署应用程序。 We do this routinely off code commits in our CI/CD environment in AWS. 我们通常在AWS的CI / CD环境中关闭代码提交。

No reason this could not be done in a non-AWS environment also. 在非AWS环境中也无法做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM