I have 4 applications running in my JBoss server. They are app1.ear, app2.ear, app3.ear, app4.war. I want the app4.war to be loaded lastly. These are NOT modules in one ear. They are seperate
applications. How can I configure in such a way that app4.war will be loaded at last(I mean after loading first 3 ear files).
and open the File org.jboss.deployment.MainDeployer-xmbean.xml and edit the following attribute
<attribute access='read-write' setMethod='setEnhancedSuffixOrder' getMethod='getEnhancedSuffixOrder'>
<description>Allows the override of the suffix order declared by subdeployers, using the syntax [order:]suffix
Statically set one or more enhanced suffix orders, independent of the value proposed by subdeployers.
Some deployers may also allow the suffixes/orders to be set locally, so that's preferable too.
For reference, this is the list of enhanced suffixes likely to be set by deployers (it may not
be completely up-to-date, or there can be user-defined deployers).
Until we resolve some startup issues, we'll setup some static enhanced suffix orders bellow
and leave the rest of the suffixes contributed dynamically by registering deployers.
<value value="250:.rar,300:-ds.xml,400:.jar,500:.war,550:.jse,600: app1.ear,610: app2.ear,620: app3.ear,630: app4.ear,650:.ear,800:.bsh"/> </descriptors>
Hope this helps you............
Joined: Dec 17, 2011
Thanks for the response...
I tried with the setting which you have given, But it is not loading the apps according to the setting.
Here is my problem in detail.
I have an application, which is dependent on another 3 applications running in the same JBoss server. My application has a Scheduler servlet, which will be loaded as soon as the server starts up. The scheduler will check for a network connection. I have coded the scheduler servlet in such a way that it has to try establishing a network connection until and unless the connection is established. Here is am getting the problem, If it is unable to establish the connection, the server is not loading any other applications in the server. My question is how can I make the server/application so that even if the connection is not established, other applications should be loaded in the server? My servlet keeps trying to establishing the connection.
For more clarity, am putting the code below.
This servlet will be loaded as soon as the server gets started up. I have specified <load-on-startup>1</load-on-startup> in the depl descriptor.
Now am testing the application by giving some wrong ipaddress to see how the server will behave? When the server is loading the applications, it is being stopped at this application. I know why it is being stopped, because it is trying to establish the connection indefinitely. Since it is not able to establish the connection, it is being stopped at this point. Can you please suggest a way in which I can avoid this problem? I am looking for a solution, in which the connection should happen in the background which will not affect the other apps in loading irrespective of whether the connection is established or not . I have tried with threads(daemon threads), Still am getting the same problem.
Seems it is a complex requirement. Any help would be greatly appreciated.
For even more clarity, I added code tags to your post.
If there is an app you want deployed last, create a directory named "deploy.last" under the "deploy" folder (e.g., server/default/deploy/deploy.last) and place your app (app4.war in your case) in that folder. Then it will be deployed last.
By the way, which version of JBoss AS? I don't think this works with AS 7.
Yes...It was loading at last with the deploy.last folder.
But for some reason, My requirement got changed. When my WAR file is being loaded, I want to establish a connection in a different thread. Its like Server will be awaiting the network connection. Till the connection established, server functionality should not be affected (I mean, because the connection establishing code will be running inside an infinite loop). Server has to function in a normal way, it should not be stopped till the connection established. Can you suggest a better solution for this problem?
I'm sorry, but I did not understand that at all. What do you mean by "different thread"? Or by "Server will be awaiting the network connection"? What what seem to imply doesn't fit at all with my understanding of deployment when the app server is started.
On the other hand, there is a mechanism to declare that one app X is dependent on an mbean created when app Y is deployed, maybe that mechanism will help you. You would need to know the full object name of an mbean created by app Y. Then for a WAR file, you would use the <depends> element in the jboss-web.xml file. See the commends in the DDT at docs/ddt/jboss-web_5_0.dtd.