Deploy J2EE assets for a single file
This option provides the ability to deploy a single file asset into the J2EE applicationthis option should not be used if this single file is a J2EE module. J2EE modules must be deployed as an entire module.
You will use this option to deploy any single assets such as:
- A single Java JAR file containing:
- Controller commands
- Data beans
- Utility classes
- A store asset, such as:
- A JSP file
- An HTML file
- A configuration XML file
- An image file
- A properties files or resource bundle
If you are deploying more than one file, it is best to group the files together and use the partial application procedure. This will be faster than doing several single file updates.
Consider the following scenario: a problem has been found in a JSP file. The developer has made the change and tested it in the development environment. The functional tester has also validated the change in the quality assurance environment. It is now time to deploy the changed file into your production server. Note that regardless of whether you use the graphical or scripting tools, always back up your J2EE assets before you deploy.
- Deploy using the WebSphere console
- Backup your J2EE assets.
- Place the changed file or JAR file either on the machine running WebSphere administrative console or the machine running the Web browser you are using to access the WebSphere console.
- Start the WAS administration server.
- Launch the WebSphere console.
- In the WebSphere console, expand Applications > Enterprise Applications.
- From the Enterprise Applications list, select the check box next to the J2EE application for your instance. This will be WC_ instance (for example, WC_demo). Click Update.
- On the Preparing for Application Installation page, under the Application update options section:
If you are typing in the directory paths, you should always use forward slashes no matter which platform you are using. You should also not prefix with a leading slash.
- Select Single file. More options, specific to a single file deployment, display.
- In the Relative path to file field, type the path and file name to your changed file. This is the path as it should be in the EAR file. It is relative to the root of the EAR file. For example, if you changed a JSP file for your store, called myfile.jsp, your relative path and file name would be similar to Stores.war/myStore/myfile.jsp. If your change is for a controller command, data bean, or Java code, then specify the relative path and file name to the JAR file you packaged for this.
- Under Upload the new or replacement files:
- If your changed file is on the same machine as the Web browser used to connect to the WebSphere console:
- Select Local file system and specify the full path and file name to your changed file. If your change is for a controller command, data bean, or Java code, then specify the path and file name to the JAR file you packaged for this.
- Click Next.
- If your changed file is on the server that your Web browser is connected to to use the WebSphere console:
- Select Remote file system and specify the full path and file name to your changed file. If your change is for a controller command, data bean, or Java code, then specify the path and file name to the JAR file you packaged for this.
- Click Next.
- The Updating Application page displays with a confirmation message, indicating your file will be updated. Click OK.
- WAS saves the updates and deploys the file. On the Updating page, click Save to Master Configuration to save your changes.
- Deploy using the wsadmin tool
- Backup your J2EE assets.
- Place the changed file or JAR file on the file system of the machine running the wsadmin tool.
- Start the wsadmin tool.
- Run the following commands depending on the language you have chosen:
- JACL
$AdminApp update WC_ instance file {-operation addupdate -contents path on local file system to source file -contenturi path within EAR $AdminConfig save
For example: $AdminApp update WC_prod file {-operation addupdate -contents /deployments/2007-01-01a/Stores.war/myStore/index.jsp -contentui Stores.war/myStore/index.jsp}
$AdminConfig save
- Jython AdminApp.update('WC_ instance', 'file', '[-operation addupdate -contents path on local file system to source file -contenturi path within EAR]')
AdminApp.save() For example: AdminApp.update('WC_prod', 'file', '[-operation addupdate -contents /deployments/2007-01-01a/Stores.war/myStore/index.jsp -contentui Stores.war/myStore/index.jsp]')
AdminApp.save()
Related tasks
Deploy custom J2EE assets
Validate changes have been deployed for a custom Enterprise Application (EAR) fileRelated reference
Troubleshoot: Deployment