开发者

how do i determine the order of startup of 2 projects in one eclipse workspace?

开发者 https://www.devze.com 2023-03-13 09:36 出处:网络
I am working on java 6开发者_开发技巧, eclipse and tomcat . I have 2 projects in a workspace , 1 is a webservices client and the other is a webservices server.

I am working on java 6开发者_开发技巧, eclipse and tomcat . I have 2 projects in a workspace , 1 is a webservices client and the other is a webservices server. both projects are deployed under tomcat instance, so when I run the tomcat server it starts up both projects. 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. Tomcat does, and it will not allow you to dictate which application should start first. You can read this related question.

0

精彩评论

暂无评论...
验证码 换一张
取 消