Administer > Deploy > Deploying customized assets > Customized WebSphere Commerce Enterprise Application (EAR) assets > Deploying custom Java EE assets
Deploy J2EE assets for a single file
This option provides the ability to deploy a single file asset into the J2EE application
Note that this 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 the production server. Note that regardless of whether you use the graphical or scripting tools, always back up the J2EE assets before you deploy.
Procedure
- Deploy using the WebSphere administrative console
- Backup the 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 administrative console.
- Start the WebSphere Application Server administration server.
- Launch the WebSphere administrative console.
- In the WebSphere administrative console, expand Applications > Application types> WebSphere Enterprise applications. .
- From the Enterprise Applications list, select the check box next to the J2EE application for the 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 Replace or add a single file. More options, specific to a single file deployment, display.
- In the Relative path to file field, specify the path to the file to be replaced or added. Beginning with the installed application archive file , type the path and file name of the 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 the store, called myfile.jsp, the relative path and file name would be similar to Stores.war/myStore/myfile.jsp. If the 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. If the 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 the changed file is on the same machine as the Web browser used to connect to the WebSphere administrative console:
- Select Local file system and specify the full path and file name to the changed file. If the 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 the changed file is on the server that the Web browser is connected to to use the WebSphere administrative console:
- Select Remote file system and specify the full path and file name to the changed file. If the 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 the file will be updated. Click OK.
- WebSphere Application Server saves the updates and deploys the file. On the Updating page, click Save to save directly to the master configuration.
- Deploy using the wsadmin tool
- Backup the 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_demo file {-operation addupdate -contents /deployments/2007-01-01a/Stores.war/myStore/index.jsp -contenturi 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_demo', 'file', '[-operation addupdate -contents /deployments/2007-01-01a/Stores.war/myStore/index.jsp -contenturi Stores.war/myStore/index.jsp]')
AdminApp.save()
Related tasks
Validate changes have been deployed for a custom Enterprise Application (EAR) file
Related reference