开发者

deploy.last in JBoss 5.1 in web configuration?

We have ear that depends on war file.

We use web configuration.

I put war file to <jbo开发者_开发问答ss_home>/server/web/deploy directory.

And I put ear file to <jboss_home>/server/web/deploy/deploy.last directory.

But ear starts prior to war.

Why?


I use a similar configuration to what you describe, though I put all the apps I want to deploy first in deploy/myapps and all the ones to deploy afterwards in deploy/myapps.last. This works correctly for me on JBoss 5.1.2.

Although I can't explain why it isn't working for you, I can offer an alternative solution. You can make the EAR declare a dependency on the WAR and JBoss will then ensure the WAR is deployed first.

First, add a file called aliases.txt into the META-INF directory of your WAR. This file should just contain a single line with an arbitrary name / identifier for your WAR. For example, if you have mywebapp.war, your META-INF/aliases.txt file could contain 'mywebapp'. It just needs to be something that won't clash with any other aliases declared by other apps deployed on the same server.

Next, add a jboss-dependency.xml file to the META-INF directory of your EAR, containing the following (subsituting 'mywebapp' for the alias you created above):

<dependency xmlns="urn:jboss:dependency:1.0">
  <item whenRequired="Real" dependentState="Create">mywebapp</item>
</dependency>

This should ensure the WAR is deployed before the EAR.

Also, if you try to deploy the EAR without the WAR being present, JBoss will log a clear deployment error message telling you about the missing dependency.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜