[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: Automatic deploy with MainDeployer

jaikiran do-not-reply at jboss.com
Tue Apr 1 11:12:04 EDT 2008


>From what i remember, the MainDeployer deploys the application in %JBOSS_HOME%/server/< serverName>/tmp folder. This tmp folder gets cleaned up on restarts. 

The last time, when i was playing around with a similar requirement on a sample application, i had deployed my own service using a *-service.xml (which extends MainDeployer) and overriden the deploy method as follows:

  | 
  | public class ExtendedMainDeployer extends MainDeployer {
  | 	
  | 	/**
  | 	 * Logger
  | 	 */
  | 	protected Logger log = Logger.getLogger(this.getClass().getName());
  | 	
  | 	/**
  | 	 * 
  | 	 */
  | 	public void deploy(URL url) throws DeploymentException {
  | 		String serverDeployFolderPath = System.getProperty("jboss.server.home.dir") + "/deploy/";
  | 		File file = new File(url.getFile());
  | 		
  | 		
  | 		//just copy it to server deploy folder and let the deployer pick it up
  | 		try {
  | 			log.info("Copying " + file.getName() + " to " + serverDeployFolderPath  + file.getName());
  | 			copy(url,new File(serverDeployFolderPath  + file.getName()));
  | 		} catch (IOException ioe) {
  | 			log.error("Could not copy " + url.getFile() + " to " + serverDeployFolderPath, ioe);
  | 			throw new DeploymentException(ioe);
  | 		}
  | 	}
  |  
  | }

All this piece of code does is it copies the application to the "deploy" folder of JBoss so that the server picks it up for deployment. This way, you dont have to worry about restarts. I am not sure whether this is an option for you, though.

Maybe someone has better ideas?



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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140577



More information about the jboss-user mailing list