anonymous wrote : (be careful to make sure app1 deploys before app2)

The best/only way I found to enforce the specific EAR deployment order upon 
JBoss AS startup was to implement my own DeploymentSorter, similar to 
PrefixDeploymentSorter:


  | public class MyDeploymentSorter extends DeploymentSorter implements 
Comparator 
  | {
  |   ...
  |   public int compare(Object o1, Object o2) {
  |     
  |     URL url1=(URL) o1;
  |     URL url2=(URL) o2;
  |     
  |     if( (url1.toString()).contains("app1.ear") &&  
(url2.toString()).contains("app2.ear") ) {
  |       return -1;
  |     }
  |     if( (url2.toString()).contains("app1.ear") &&  
(url1.toString()).contains("app2.ear") ) {
  |       return 1;
  |     }
  |     return super.compare(url1, url2);
  |   }
  | }
  | 

Then, obviously, I configure conf/jboss-service.xml to use my deployment sorter:

  | <attribute name="URLComparator">org.fqn.MyDeploymentSorter</attribute>
  | 

Is there another way to do this? I burned up some hours on this, mainly because 
I couldn't let go of the expectation that deployment ordering should be 
automatic if there are dependencies (e.g., app2.ear contains an EJB that 
depends on an EJB in app1.ear), OR that there must be some way to specify 
deployment ordering in a deployment descriptor. Unless I've missed something, 
there isn't, but MyDeploymentSorter does what I want. Sorry if I'm getting 
off-topic. 

Cheers,

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997682#3997682

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997682
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to