RAD(Rational Application Developer)——清理、发布、重新启动
我目前在 websphere 6.1 环境中使用 Spring 3.0 框架。我使用的 IDE 是 RAD (Rational Application Developer) 7.5。昨晚我正在解决一个问题,我发现在工作区进行更改后,我的代码并未在服务器上 100% 刷新。我的问题是,从 websphere 的角度来看,以下各项之间有什么区别:
- 重新启动安装了 EAR 的整个服务器
- 在 WebSphere 中清理 EAR
- 单击项目并选择发布 在
开发 J2EE 时,其他应用程序服务器/IDE 是否有相同类型的同步问题应用程序?
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:
- Restarting the entire server with an EAR installed
- Cleaning an EAR within WebSphere
- Clicking on the project and selecting publish
Do other Application Server / IDEs have the same type of syning issues when developing J2EE applications?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 RAD,这是默认行为。当您“清理”时,它会删除已编译的对象并通过“构建全部”重新创建它们,然后执行“发布”。当您“构建”时,它会构建它认为必要的任何内容,然后进行“发布”。当您“构建全部”时,它会构建所有对象,然后进行“发布”。
当您(或通过上述命令的 IDE)执行“发布”时,它会获取所有已编译的对象并将它们部署到您为此项目设置的服务器上(如果服务器正在运行,则通过热交换) )。热交换对于某些事物(例如 JSP)效果很好,但对于其他事物(配置文件、EJB 等)效果不佳。如果无法正确进行热插拔,您需要恢复您的服务器。
例如,如果您有 RAD 设置来自动构建,您的服务器正在运行,并且您更改了 EJB,将会发生什么:
1. EJB将被编译
2. 如果项目正常,RAD 将部署您的更改
3. 服务器可能无法拾取您的热插拔更改,因此服务器将继续运行旧代码
当发生这种情况时,服务器会反弹并且代码将被拾取。
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.
重新启动服务器将需要一些时间,但如果文件存在于文件系统上,肯定会重新加载文件。我不确定是否从服务器视图中调用 Clean。
如果您在服务器视图中调用发布,RAD 将在服务器上重新启动应用程序。因此,更改通常会被采纳。
您需要了解您所做的更改类型,并了解 WebSphere Application Server 需要什么来加载更改。如果滚动到链接帮助条目的底部,您可以看到每个 JavaEE 模块类型的文档链接,该文档描述了需要执行哪些操作才能获取更改。
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/trun_app_hotupgrade。否则
,您应该了解从更改到在浏览器中获取它所发生的整个生命周期,例如文件更改、文件编译、准备部署运行、类加载器看到更改、注意到应用程序需要重新启动,用户调用 Republish 重新启动服务器上的应用程序,用户刷新网页,Firefox 在 Firebug 中显示 HTTP 标头中的 Last-Modified 时间戳已更改。
我不确定热插拔是什么意思,但是在调试服务器时,如果没有对类的引用或者类结构没有更改,热代码方法替换可以替换调试服务器中的类。
本网站上的帖子是我自己的,并不一定代表 IBM 的立场、策略或意见
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