简体   繁体   English

如何确定一个月食区中2个项目的启动顺序?

[英]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.

相关问题 我怎样才能计算eclipse工作区中的项目数量? - How can I count the number of projects in eclipse workspace? 如何更改默认的Eclipse启动工作区? - How to change the default Eclipse startup workspace? 如何将 Eclipse 项目上传到 GitHub? - How Do I Upload Eclipse Projects to GitHub? 为什么我的Eclipse插件启动可以在一个工作空间中正常运行,而不能在另一个工作空间中正常运行? - Why does my Eclipse plugin startup fine in one workspace, but not in another? 如果一个源文件提到工作区中的两个项目,Eclipse 如何选择需要的文件进行调试 - Eclipse how to select needed file for debug if one source file mentions from two projects within workspace 如何在Eclipse Project Viewer中将多个项目从一个git repo合并到一个文件夹中? - How do i consolidate a bunch of projects from one git repo into a single folder In Eclipse Project viewer? 如何使用 java 程序更改 eclipse 工作区位置 - How do i change eclipse workspace location, using a java program 如何将Eclipse类路径变量从一个工作空间复制到新工作空间? - How can I copy Eclipse classpath variables from one workspace to a new workspace? 如何将旧文件从Java Eclipse工作区复制到新工作区中? - How do I copy over my old files from my Java Eclipse workspace into my new workspace? 从 eclipse 工作区移动项目 - Moving projects from eclipse workspace
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM