[英]how do i determine the order of startup of 2 projects in one eclipse workspace?
I am working on java 6, eclipse and tomcat . 我正在使用Java 6,eclipse和tomcat。 I have 2 projects in a workspace , 1 is a webservices client and the other is a webservices server. 我在工作区中有2个项目,一个是webservices客户端,另一个是webservices服务器。 both projects are deployed under tomcat instance, so when I run the tomcat server it starts up both projects. 这两个项目都部署在tomcat实例下,因此当我运行tomcat服务器时,它将启动这两个项目。 when the client project starts up before the server project service is available , the client gets stuck in the following function and dosent finish to startup: 当客户端项目在服务器项目服务可用之前启动时,客户端将陷入以下功能,并且必须完成启动:
protected Service(java.net.URL wsdlDocumentLocation, QName serviceName) {
delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
serviceName,this.getClass());}
so I need the server project to start first and have the client project start only after the server finishes. 因此,我需要首先启动服务器项目,并且仅在服务器完成后才启动客户端项目。
is that possible? 那可能吗?
The short answer - you need to write your client application so that it can detect if the server application is down and act accordingly . 简短的答案- 您需要编写客户端应用程序,以便它可以检测服务器应用程序是否关闭并采取相应措施 。 If the dependencies run both ways, then you have to ensure that the failure conditions are handled in both. 如果依赖项同时运行,则必须确保在两种情况下都处理故障情况。
Also, ensure they don't depend on each other during container startup; 另外,请确保它们在容器启动期间不会相互依赖; the dependency can be established later, when the applications have all started. 应用程序全部启动后,可以在以后建立依赖关系。 This in part because, Eclipse does not determine the startup order. 这部分是因为Eclipse不能确定启动顺序。 Tomcat does, and it will not allow you to dictate which application should start first. Tomcat可以,并且它不允许您规定应首先启动哪个应用程序。 You can read this related question . 您可以阅读此相关问题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.