When to wait for the time interval of an automatic publishing to pass on a WebSphere Application Server

You can set an interval of time of when changes to the files that run on the server are automatically reloaded to the server. The following subtopics describe different situations when you might be waiting for the interval of time to pass for the workbench to issue an automatic publish command on a WebSphere® Application Server. In some cases, you do not need to wait for the interval of time to pass when the changes to the applications are dynamically reloaded to the server, which depends on the type of resource that is modified, the location of the server and its publishing setting option, and the mode you are running the server. The table summarizes these situations.

Automatically publishing to a server

Important: Applicable to WebSphere Application Server traditional

If the Automatically publish when starting servers check box on the Server preferences page (Window > Preferences > Server > Launching) is selected, the workbench checks to see if your project and files on the server are synchronized. If they are not, the project and the files are automatically updated when the server is either started or restarted.

In the workbench, you have several options to choose for the Publishing settings. You can set these Publishing settings by going into the Servers view, right-click the server and select Open. The Server editor opens. In the Overview page of the server editor, under the Publishing settings, you are going to find the following settings:
  • Never publish automatically: Specifies that the workbench never publishes files to the server.
  • Automatically publish when resources change: Specifies the workbench to issue a publish after changes on a file that is associated to the server are saved and a full-time interval that is passed in the Publishing interval setting.
  • Automatically publish after a build event: Specifies the workbench to issue a publish after changes on a file that requires a build and is associated to the server are saved, and a full-time interval that is passed in the Publishing interval setting.
  • Publishing interval (in seconds): Specifies the number of seconds that needs to pass before the workbench calls a publish to happen on the server. However, if you make a subsequent change to the files before this time interval has completed, the publish is delayed as the timer is reset. The workbench makes a publish to the server only after the full-time interval passed. If you set the publishing interval to 0 seconds, an immediate publish happens after changes on a file are saved.

In the workbench, the default setting is the Automatically publish when resources change option is enabled with a value set in the publishing interval.

Manually publishing to a server

If you do not want to wait for the automatic publishing interval to pass, at anytime you can manually request the workbench to issue a publish command to the server. Each manual publish command causes a single publishing request to the server. To publish your application manually, you can complete one of the following in the Servers view:

  • Select the server and then click the Publish to the server icon that is on the toolbar.
  • Right-click the server and then select Publish.

Location of the server and its publishing settings

The location of the server whether it is a remote or local server, together with its publishing settings whether it is using Run server with resources on Server or Run server with resources within the workspace option, are factors that define if you require to wait for the interval of time to pass for the workbench to issue an automatic publish command on a WebSphere Application Server. Keep in mind, you can at anytime issue a manual publish request to eliminate the wait, see the Manually publishing a server section.

The following is a list of servers that require you to always wait for the publishing interval to pass in order for the workbench to issue an automatic publish command.
  • A remote WebSphere Application Server
  • A local WebSphere Application Server when you are using the Run server with resources on Server publishing settings
The following is a list of servers that depends on the type of resource that is modified and the mode you are running the server determines if a wait is required for the publishing interval to pass in order for the workbench to issue an automatic publish command.
  • A local WebSphere Application Server when you are using the Run server with resources within the workspace publishing settings

Mode of the server

In some cases, the requirement to wait for the automatic publishing interval to pass depends on the mode you are running the server. There are two modes of running applications on the server:
Run on Server
This command specifies to run your application on the server. It is available when you right-click your artifact in the Enterprise Explorer view and select Run As > Run on Server. The Run on Server wizard opens.
Debug on Server
This command specifies to control the running of your application by stopping at breakpoints, suspending threads, stepping through the code, and examining the contents of the variables while you are running your application on the server. It is available when you right-click your artifact in the Enterprise Explorer view and select Debug As > Debug on Server. The Debug on Server wizard opens.

Changes to JSP, HTML, graphic, and non-Java files

This subtopic is applicable to a local WebSphere Application Server by using the Run server with resources within the workspace publishing settings.

If you change a JSP file, HTML file, GIF file, JPG file, or similar resource, and save the file while the server is running, you must only refresh the web browser for the server to recognize the change. However, if the application contains multiple roots, you need to issue a publish command for the server to recognize the change. To determine whether the structure of your application contains a single or multiple roots use the Project Structure Validator. For details, see Creating and configuring Java™ EE projects using wizards.

Changes to servlets and related classes

This subtopic is applicable to a local WebSphere Application Server by using the Run server with resources within the workspace publishing settings.

If you change a servlet and save the file while the server is running, the requirement to wait for the automatic publishing interval depends on the mode you are running the server.
  • Run on Server: You need to wait for the automatic publishing interval to pass and then refresh the web browser for the server to recognize the change.
  • Debug on Server: Hot method replace automatically runs in debug mode for WebSphere Application Server. You do not need to wait for the automatic publishing interval to pass as changes to the servlets are dynamically reloaded to the local server. However, if the application contains multiple roots, you need to issue a publish command for the server to recognize the change. To determine whether the structure of your application contains a single or multiple roots use the Project Structure Validator. For details, see Creating and configuring Java EE projects using wizards.

Changes to a bean class of an EJB

This subtopic is applicable to a local WebSphere Application Server by using the Run server with resources within the workspace publishing settings.

If you change a bean class of an EJB and save the file while the server is running, the requirement to wait for the automatic publishing interval depends on the mode you are running the server.
  • Run on Server: You need to wait for the automatic publishing interval to pass for the server to recognize the change.
  • Debug on Server: Hot method replace automatically runs in debug mode for WebSphere Application Server. You do not need to wait for the automatic publishing interval to pass as changes to a bean class of an EJB are dynamically reloaded to the local server. However, if the application contains multiple roots, you need to issue a publish command for the server to recognize the change. To determine whether the structure of your application contains a single or multiple roots use the Project Structure Validator. For details, see Creating and configuring Java EE projects using wizards topic.

Changes to a local or remote interface of an EJB

This subtopic is applicable to a local WebSphere Application Server by using the Run server with resources within the workspace publishing settings.

If you change a local or remote interface of an EJB and save the file while the server is running, you must wait for the automatic publishing interval to pass.

Changes to resources within an enterprise application

This subtopic is applicable to a local WebSphere Application Server by using the Run server with resources within the workspace publishing settings.

Changes to resources within an enterprise application include the deployment descriptor files, and the Deployment page of the Application Deployment Descriptor editor. If you change any of these resources and save the file while the server is running, you must wait for the automatic publishing interval to pass.

Table 1. Summary of wait requirements for the automatic publishing interval to pass when resources are modified while the server is running in different modes with the Run server with resources within the workspace publishing settings
  Do you need to wait for the automatic publishing interval to pass?
Resource modified Run on Server Debug on Server with Hot method replace
JSP No, you need only to refresh the web browser for the server to recognize the change. 1
HTML No, you need only to refresh the web browser for the server to recognize the change. 1
Servlets Yes, and then refresh the web browser for the server to recognize the change. No.1
EJB bean class Yes. No.1
EJB local and remote interface Yes.
Deployment descriptor files Yes.
Deployment page of the Application Deployment Descriptor editor Yes.
Note: Hot method replace automatically runs in debug mode for WebSphere Application Server.
1 However, if the application contains multiple roots, you need to issue a publish command for the server to recognize the change. To determine whether the structure of your application contains a single or multiple roots use the Project Structure Validator. For details, see Creating and configuring Java EE projects using wizards topic.
Icon that indicates the type of topic Concept topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: csrvpub.html