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

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

143k 29 29 gold badges 222 222 silver badges 221 221 bronze badges asked Feb 23, 2010 at 15:39 jwmajors81 jwmajors81 1,430 4 4 gold badges 21 21 silver badges 36 36 bronze badges

2 Answers 2

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.

answered Feb 23, 2010 at 16:08 943 5 5 silver badges 12 12 bronze badges

Restarting the server will take some time but surely reload the files if they exist on the file system. I am not sure about calling Clean from the Servers view.

If you call Publish within Servers view, RAD will restart the application on the server. Thereby changes normally get picked up.

You need to understand what kind of change you did and see what WebSphere Application Server requires to load the change. If you scroll to the bottom of the linked help entry, you can see for each JavaEE module type a link to a document which describes what needs to be done to pickup the changes. http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/trun_app_hotupgrade.html

Otherwise, you should understand the whole lifecycle of what happens from the change to picking it up in the browser, e.g. change on the file, file gets compiled, prepare for deployment runs, classloader sees the change, notices that application needs to be restarted, user calls Republish to restart the application on the server, user refreshes the web page, Firefox shows within Firebug that the Last-Modified timestamp in HTTP header changed.

I am not sure what hot-swap means but when debugging the server, hot code method replacement can replace a class within the debugged server if there is no reference held to the class or the class structure has not changed.

The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM