Hot method replace when debugging applications on WebSphere Application Server
If you want to change to your Java™ classes while you are debugging, the hot method replace is automatically enabled when you are running an application in debug mode on WebSphere® Application Server. Hot method replace allows most application changes to pick up automatically without requiring an application or server restart.
Tips about hot method replace:
- [WebSphere Application Server traditional] Hot-method replace cannot be used while you are profiling an application. When you profile an application, data that is related to the runtime behavior of a program is collected and presented in both graphical and tabular views. Using profiling, you can see which operations take the most time and helps you to find and solve memory leaks. For more information, see the Profiling documentation.
- [WebSphere Application Server traditional] When you are using hot method replace to debug servlets, the server reloads a method that is changed. It does not reload the class or reload and reinitialize the servlet.
- [WebSphere Application Server traditional] JSP debugging does not support hot method replace.
- [WebSphere Application Server traditional] When hot method replace automatically running, the JIT compiler is also enabled. The JIT compiler that is used when hot method replace is running, is much faster than when you are using normal debugging. The JAVA_COMPILER=NONE environment variable and system property -Djava.compiler=NONE to disable the JIT compiler is going to be ignored if hot method replace is running when debugging an application. When hot method replace is running, the -Xint option is going to disable the JIT compiler.
- [WebSphere Application Server traditional] If Run -Xquickstart in the Java virtual machine settings check box is selected in the server editor, the workbench ignores this option when the server starts in debug mode. The -Xquickstart JVM setting on startup does not run when the server starts in debug mode. For more information, see Optimize starting the WebSphere Application Server for development
When a Liberty server is running in debug mode, any modifications to method annotations are not automatically updated on the server. In the following example, modifications to the @onMessage method annotation are not updated automatically, because hot method replace is enabled by default in debug mode. Changes to method annotations are not handled by hot method replace. Publishing is required to load the changes.
@OnMessage public void receiveMessage(String message) { try { count++; .............