English 中文(简体)
RAD (Rational Application Developer) -- Clean vs. Publish vs Restart
原标题:

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?

最佳回答

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.

问题回答

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





相关问题
Webspehere 6.1 and JNDI for something other than a Datasource

I was wondering: how does one go about configuring WAS if they want to store some confidential information that is not datasource, JMS or Mail related? I m looking more for an adhoc JNDI resource (a ...

申 诉 Server的服务器名称或管道和港口

我们愿确定并展示一个服务器和港口,即 Java的应用程序正在运行,它落后于一个代理网络服务器。 这意味着使ServerName()返回服务器......。

Signing SOAP messages using WSS4J

We need to sign a SOAP message with a certificate in Websphere 7. Currently we are looking at using WSS4J from Apache and are approaching this in the java code itself. Does anyone have any ...

JSP files in external directory

In my project, we allow customer to write customer specific logic in JSP pages and attach to our product. Right now after deploying .ear file customer copy the custom files under /WebContent/custom ...

RAD Websphere - EAR not picking up latest jar

I am using RAD 7.0. My web application works with a jar(contains the backend code for our application) which undergoes frequent changes. But whenever I replace the jar in the WebInf/lib folder of the ...

热门标签