*
The moose likes JBoss/WildFly and the fly likes Regarding Jboss Restart through Java Coding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Regarding Jboss Restart through Java Coding" Watch "Regarding Jboss Restart through Java Coding" New topic
Author

Regarding Jboss Restart through Java Coding

santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 146
hi,

This is Santhosh i need to restart jboss through java coding, I do not know how to make code in java please help me.




Thanks in advance
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5837
    
    7

You said 'restart' so I assume that the app server is running already.

To stop the app server, you can do one of two things:
a) Use Runtime.exec() to call the shutdown script
b) Call the server MBean to shut down the app server (see how the shutdown script goes about this, and look at the org.jboss.Shutdown class in the source)

To start the app server, use Runtime.exec() to run the run script.

Or you could create a script to do the stop and start and simply call that script using Runtime.exec(). The service.bat and jboss_init_*.sh scripts contain such script code.


JBoss In Action
santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 146
hi,

This is santhosh your document is very nice but i need script to restart the Jboss, in my project i have one screen that screen shows all the keys and values from struts resource bundle if we change any values in that screen it should affect all the screen but it is not working without restarting the jboss please help me.

Thanking You.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10213
    
166

santhosh kumar vk wrote:hi,

in my project i have one screen that screen shows all the keys and values from struts resource bundle if we change any values in that screen it should affect all the screen but it is not working without restarting the jboss please help me.


So you are trying to restart the server through your program whenever someone changes a value on the screen, just so that it gets reflected across the application? That's not the right way to do it. You should first find why the changed value is not being reflected across the application and then try to fix that part.


[My Blog] [JavaRanch Journal]
santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 146
hi,

You are telling correct but we are doing ERP Product so we have to sale to different customer at the time customer like to change the labels in that screen suppose we make this type of screen that would be helpful for ours and customer they can change the labels that is why i am asking please help me.

Advance Thank You.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5837
    
    7

Provide a separate configuration application what displays the Struts resources. When the customer commits the changes, the app packages the bundle and deploys the real app.
 
jQuery in Action, 2nd edition
 
subject: Regarding Jboss Restart through Java Coding