File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes How to provide th ordering of applications in JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to provide th ordering of applications in JBoss" Watch "How to provide th ordering of applications in JBoss" New topic
Author

How to provide th ordering of applications in JBoss

Sunil Ragidi
Greenhorn

Joined: Dec 17, 2011
Posts: 6
Hi techies,

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).

Any help would be greatly appreciated...

Thanks,
Sunil
Ifteqar Ahmed
Ranch Hand

Joined: May 02, 2011
Posts: 85

Hi,

Go to jbossAS\server\default\conf\xmdesc\

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
</description>
<name>EnhancedSuffixOrder</name>
<type>[Ljava.lang.String;</type>
<!--
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.
-->
<descriptors>
<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>
</attribute>



Hope this helps you............
Sunil Ragidi
Greenhorn

Joined: Dec 17, 2011
Posts: 6
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.

Thanks,
Sunil



Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

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.


JBoss In Action
Sunil Ragidi
Greenhorn

Joined: Dec 17, 2011
Posts: 6
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?

Thanks,
Sunil
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to provide th ordering of applications in JBoss