RAD (Rational Application Developer) -- Clean vs. Publish vs Restart

jwmajors81 picture jwmajors81 · Feb 23, 2010 · Viewed 16.9k times · Source

I am currently using the Spring 3.0 framework in a websphere 6.1 environment. The IDE I am using is RAD (Rational Application Developer) 7.5. I was working on a problem last night and I found that my code wasn't being 100% refreshed on the server after making a change in my workspace. My question is what is the difference from websphere's perspective between the following:

  1. Restarting the entire server with an EAR installed
  2. Cleaning an EAR within WebSphere
  3. Clicking on the project and selecting publish

Do other Application Server / IDEs have the same type of syning issues when developing J2EE applications?

Answer

SOA Nerd picture SOA Nerd · Feb 23, 2010

With RAD here's the default behavior. When you 'clean' it gets rid of the compiled objects and recreates them via a 'build all' then does a 'publish'. When you 'build' it builds anything it thinks is necessary then does a 'publish'. When you 'build all' it builds all objects then does a 'publish'.

When you (or your IDE via the commands above) does a 'publish' it takes all of your compiled objects and deploys them onto the server that you've setup for this project (via a hot swap if the server is running). Hot swaps work well for some things (such as JSPs) but not as well for other things (configuration files, EJBs, etc). If unable to do a hot swap correctly you need to bounce your server.

For example, if you have RAD setup to automatically build, your server is running, and you change an EJB what will happen is:
1. The EJB will be compiled
2. If the project is OK RAD will deploy your changes
3. The server will probably not be able to pickup your hotswapped changes so the server will continue to run the old code

When this happens bounce the server and the code will be picked-up.