简体   繁体   中英

How to redeploy an application on Jboss within Eclipse?

I'm developing a spring-based application with facelets and Java Server Faces which works on Jboss Application Server. As a development Framework, I'm using Eclipse Ganymede Platform Version: 3.4.2 , which integrates the Web Standard Tools and therefore offers support for different servers, like Jboss 5.0.

I'm deploying my app on Jboss within Eclipse. First time it runs fine, but when I try to make some changes and republish my application, it just doesn't get it, so I'm forced to restart the server. This is quite annoying since it takes about a minute or so each time I have to restart JBoss.

So, the question is: is there any means to redeploy apps on Jboss without having to restart it?

Consider the use of JBoss tools plugin. It significantly improves the experience of development with Eclipse and JBoss. http://www.jboss.org/tools

If you manage the JBoss (start/stop) using the eclipse you should be able to redeploy directly form the eclipse.

If you are deploying to the deploy directory, then running over the original war/ear will cause it to re-deploy. Notice that depends on your app size you may encounter OutOfMemoryErrors.

What we do (though it doesn't always work) is that we deploy an ear, run the JBoss and debug remotely using the JPDA. When we make a change (as long as you do not change the signature of a method) it hot swaps the class to the one with the change.

If your deploying a WAR file then the easiest way is to use the 'servers' plugin in eclipse. MyEclipse comes pre-configured.

Here you will be able to select your servlet container and will have full control within eclipse. No need for any ANT files or need to leave your Eclipse IDE.

In order for this setup to work, your project needs to be a 'Web Project'.

Once you have setup your web project, hit the configuration button in the servers window, select your web project and add it.

Then hit the run/debug button on the servers screen.

The only gotcha is, you need to make sure your source classpath points to WEB-INF/classes not target/classes in order for hot deploy to work. The maven plugin eclipse:eclipse resets this so beware.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM