WAS v8.5 > Deploy applications > Deploy enterprise applicationsInstall enterprise application files by adding properties files to a monitored directory
We can use application properties files to install enterprise application files on a server, update deployed applications or modules, or uninstall deployed applications or modules. Drag or copy a properties file to a monitored directory and the product performs the deployment action described in the properties file. The enterprise application files that we can install, update, or uninstall using properties files include EAR, web archive (WAR), JAR, and SIP archive (SAR) files. An enterprise application file must conform to the Java EE specification.
Develop and assemble the EAR, JAR, WAR, or SAR file. We can use a supported assembly tool such as an IBM Rational Application Developer for WebSphere Software product to specify bindings and assemble the file.
Unlike the procedure described in Installing enterprise application files by adding them to a monitored directory, which does not change existing Java Naming and Directory (JNDI) and other application bindings, we can set bindings in a properties file.
By default, monitored directory deployment is not enabled. Before we can use monitored directory deployment, enable it. See Set monitored directory deployment values.
Restriction: Installing an EAR, JAR, WAR, or SAR file by adding a properties file to a monitored directory is available only on distributed or z/OS operating systems. It is not supported on IBM i operating systems. We can deploy an EAR, JAR, WAR, or SAR file to an application server by dragging or copying an application properties file to a monitoredDeployableApps/deploymentProperties monitored directory. WAS v8.5 scans a monitored directory for new properties files no more frequently than every 5 seconds, by default. After finding a new properties file in a monitored directory, the product automatically runs the wsadmin applyConfigProperties command, installs the application or module on the application server, and starts the application or module.
We do not need to start wsadmin or enter any commands to deploy the application or module. Simply add a properties file to a monitored directory. WAS v8.5 runs the wsadmin applyConfigProperties command for you.
We can also use a properties file to update or delete a deployed application or module. The server must be running so the product can detect changes to files in its monitored directory.
This topic assumes that we use a graphical file browser to drag or copy the properties file. Alternatively, we can use operating system commands to copy a file into a monitoredDeployableApps/deploymentProperties monitored directory.
- Create a properties file that defines the deployment task to complete.
The examples at the end of this topic provides sample application properties files for use in monitored directories.
The properties files that we use in monitored directories are like the properties files described in the topic about using application properties files to install, update, and delete enterprise application files. However, properties files used for monitored directories differ slightly:
- We do not need to specify statements such as CreateDeleteCommandProperties=true in the header.
- To uninstall an enterprise application, we specify DELETE=true in the header of the properties section.
Only specify application resource type operations, ImplementingResourceType=Application, in the properties file. If the properties file contains a non-application resource type such as ImplementingResourceType=Server, the product will return an error message and not perform the operation on the resource type.
We can use an edited properties file to install or update an application. To extract the properties file of a deployed enterprise application to edit or use as a template, run the extractConfigProperties command:
- Extract application properties to a file that uses the old application output format.
AdminTask.extractConfigProperties('[-propertiesFileName myApp.props -configData Deployment=MyApplication]')
Running this Jython example produces a file named myApp.props that lists the properties of an Application configuration object named MyApplication. By default, the extractConfigProperties command produces output that displays all columns, including hidden and non-hidden columns, of install task and task data values in separate rows. The mutables row shows which columns we can edit (true) and which we cannot edit (false).
... taskName=MapModulesToServers mutables={false false true false false false} #readonly row0={module uri server ModuleVersion moduletype moduletypeDisplay} # readonly ...This format is shown in the example Install an enterprise application with various task options using the old application output format.
- Extract application properties to a file that uses the simple output format.
AdminTask.extractConfigProperties('[-propertiesFileName myApp.props -configData Deployment=MyApplication -options [[SimpleOutputFormat true]]]')Running this Jython example with the SimpleOutputFormat option set to true produces a file named myApp.props that lists the properties of an Application configuration object named MyApplication in an easier to read format. The output displays non-hidden columns of application properties in columnName=value pairs. Hidden columns of application properties are not included in the output.
... taskName=MapModulesToServers row0={ module="My EJB Module" #readonly uri=MyEjbModule.jar,META-INF/ejb-jar.xml #readonly server=WebSphere:cell=!{cellName},node=!{nodeName}, server=!{serverName} } ...This format is shown in the example Install an enterprise application with various task options using the simple output format.
For more information about extracting application properties and the output formats, see the topic on using application properties files to install, update, and delete enterprise application files.
- Ensure the application server on which to install the enterprise application file is running.
- Ensure that monitored directory deployment is enabled.
See Setting monitored directory deployment values.
- Open a file browser and create the deploymentProperties monitored directory.
For base (stand-alone) application servers, the monitored directory is under the application server profile. After creating the deploymentProperties directory, the directory path is app_server_root/profiles/application_server_profile_name/monitoredDeployableApps/deploymentProperties.
- Copy the properties file to the deploymentProperties monitored directory.
Results
WAS v8.5 adds a directory having the same name as the file to the installedApps/cell_name directory of the profile.
Also, the product writes messages about the application deployment to the SystemOut.log file in the app_server_root/logs/server_name directory. The messages start with the CWLDD message key.
The messages indicate the product deployed the application file and the application is running.
IBM recommends using the HPEL log and trace infrastructure. With HPEL, one views logs using the LogViewer command-line tool in PROFILE/bin.
Example
The following example properties files provide templates that we can modify to deploy the applications:
- Install an enterprise application on a deployment target
- Install an enterprise application with various task options using the old application output format
- Install an enterprise application with various task options using the simple output format
- Update a single file in a deployed enterprise application
- Remove a single file from a deployed enterprise application
- Update a single module in a deployed enterprise application
- Remove a single module from a deployed enterprise application
- Replace, add, or delete multiple files of a deployed enterprise application
- Replace the entire deployed enterprise application
- Uninstall an application from a deployment target
- Edit the deployment options of a deployed application
- Edit web module deployment properties
Install an enterprise application on a deployment target
Required properties. Specify the properties in this table in the properties file.
Property Description Name Name of application to install. TargetServer Name of server on which application to be installed TargetNode Name of node on which application to install EarFileLocation Location of the enterprise archive (EAR file). Provide a fully qualified path name. # # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=hello TargetServer=!{serverName} TargetNode=!{nodeName} EarFileLocation=/temp/HelloWorld.ear #TargetCluster=cluster1 EnvironmentVariablesSection # # #Environment Variables cellName=myCell nodeName=myNode serverName=myServerInstall an enterprise application with various task options using the old application output format
The example properties install an enterprise application with task options. The properties file displays all columns, including hidden and non-hidden columns, of install task and task data values in separate rows. The mutables row shows which columns we can edit (true) and which we cannot edit (false).
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=!{applicationName} EarFileLocation=c:/temp/HelloWorld.ear # # SubSection 1.0.2 # MapModulesToServers Section. taskName # and row0 should not be edited. row0 contains column names # for the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=MapModulesToServers mutables={false false true false false false} #readonly row0={module uri server ModuleVersion moduletype moduletypeDisplay} # readonly row1={“My Web Module” myWebModule.war,WEB-INF/web.xml WebSphere:cell=!{cellName},node=!{nodeName},server=!{serverName} 14 moduletype.web "Web Module"} row2={"My EJB module" MyEjbModule.jar,META-INF/ejb-jar.xml WebSphere:cell=!{cellName},node=!{nodeName},server= !{serverName} 13 moduletype.ejb "EJB Module"} # # SubSection 1.0.3 # MapRolesToUsers Section. taskName and # row0 should not be edited. row0 contains column names for # the tasks. #ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=MapRolesToUsers row0={role role.everyone role.all.auth.user role.user role.group role.all.auth.realms role.user.access.ids role.group.access.ids} #readonly mutables={false true true true true true true true} #readonly row1={administrator AppDeploymentOption.No AppDeploymentOption.No "adminuser" "admingroup" AppDeploymentOption.No "" ""} # # SubSection 1.0.4 # BindJndiForEJBNonMessageBinding # Section. taskName and row0 should not be edited. row0 # contains column names for the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # #Properties # taskName=BindJndiForEJBNonMessageBinding row0={EJBModule EJB uri JNDI ModuleVersion localHomeJndi remoteHomeJndi} #readonly mutables={false false false true false true true} #readonly row1={"My EJB module" myEjb myEjbModule.jar,META-INF/ejb- jar.xml myEjb 20 "" “"} # # SubSection 1.0.5 # MapEJBRefToEJB Section. taskName and # row0 should not be edited. row0 contains column names for # the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # #Properties # taskName=MapEJBRefToEJB row0={module EJB uri referenceBinding class JNDI ModuleVersion} #readonly mutables={false false false false false true false} #readonly row1={"My EJB module" myEJB MyEjbModule.jar,META-INF/ejb- jar.xml myEJB com.ibm.defaultapplication.Increment Increment 23} # # SubSection 1.0.6 # DataSourceFor20EJBModules Section. # taskName and row0 should not be edited. row0 contains # column names for the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # #Properties # taskName=DataSourceFor20EJBModules row0={AppVersion EJBModule uri JNDI resAuth login.config.name auth.props dataSourceProps} #readonly mutables={false false false true true true true true} #readonly row1={13 "My EJB module" MyEjbModule.jar,META-INF/ejb- jar.xml MyDataSource cmpBinding.perConnectionFactory "" "" ""} # # SubSection 1.0.7 # DataSourceFor20CMPBeans Section. # taskName and row0 should not be edited. row0 contains # column names for the task.# ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=DataSourceFor20CMPBeans row0={AppVersion EJBVersion EJBModule EJB uri JNDI resAuth login.config.name auth.props} #readonly mutables={false false false false false true true true true} #readonly row1={13 13 "My EJB module" MyEjb MyEjbModule.jar,META- INF/ejb-jar.xml myDataSource cmpBinding.perConnectionFactory "" ""} # # SubSection 1.0.8 # MapWebModToVH Section. taskName and # row0 should not be edited. row0 contains column names for # the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # Properties # taskName=MapWebModToVH row0={webModule uri virtualHost} #readonly mutables={false false true} #readonly row1={"My Web Application" MyWebModule.war,WEB-INF/web.xml default_host} # # # SubSection 1.0.9 # CtxRootForWebMod Section. taskName and # row0 should not be edited. row0 contains column names for # the task.# ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=CtxRootForWebMod row0={webModule uri web.contextroot} #readonly mutables={false false true} #readonly row1={"My Web Application" MyWebModule.war,WEB-INF/web.xml /} # # SubSection 1.0.10 # MapSharedLibForMod Section. taskName # and row0 should not be edited. row0 contains column names # for the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=MapSharedLibForMod row0={module uri sharedLibName} #readonly mutables={false false true} #readonly row2={"My Web Application" MyWebModule.war,WEB-INF/web.xml ""} row1={myApp META-INF/application.xml ""}# # # SubSection 1.0.11 # JSPReloadForWebMod Section. taskName # and row0 should not be edited. row0 contains column names # for the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=JSPReloadForWebMod row0={webModule uri jspReloadEnabled jspReloadInterval} #readonly mutables={false false true true} #readonly row1={"My Web Application" MyWebModule.war,WEB-INF/ibm-web- ext.xmi AppDeploymentOption.Yes} # # # SubSection 1.0.35 # SharedLibRelationship Section. # taskName and row0 should not be edited. row0 contains # column names for the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=SharedLibRelationship row0={module uri relationship compUnitName matchTarget origRelationship} #readonly mutables={false false true true true false} #readonly row2={"My Web Application" MyWebModule.war,WEB-INF/web.xml "" "" AppDeploymentOption.Yes ""} row1={myApp META-INF/application.xml "" "" AppDeploymentOption.Yes ""} # EnvironmentVariablesSection # # Environment Variables # applicationName=myApp cellName=myCell nodeName=myNode serverName=myServerInstall an enterprise application with various task options using the simple output format
The example properties install an enterprise application with task options. The example shows application properties that have been extracted with the SimpleOutputFormat option. With this option, the properties file displays non-hidden columns of application properties in columnName=value pairs. Hidden columns of application properties are not included in the output. You might find that extracting application properties files with the SimpleOutputFormat option produces a format that is easier to read and edit.
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=!{applicationName} EarFileLocation=c:/temp/HelloWorld.ear # # SubSection 1.0.2 # MapModulesToServers Section. taskName # and lines marked as "#readonly" should not be edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=MapModulesToServers row0={ module="My EJB Module" #readonly uri=MyEjbModule.jar,META-INF/ejb-jar.xml #readonly server=WebSphere:cell=!{cellName},node=!{nodeName}, server=!{serverName} } row1={ module="My Web Module" #readonly uri=myWebModule.war,WEB-INF/web.xml #readonly server=WebSphere:cell=!{cellName},node=!{nodeName}, server=!{serverName} } # # SubSection 1.0.3 # MapRolesToUsers Section. taskName and # lines marked as "#readonly" should not be edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=MapRolesToUsers row0={ role="All Role" #readonly role.everyone=AppDeploymentOption.No role.all.auth.user=AppDeploymentOption.Yes role.user="" role.group="" role.all.auth.realms=AppDeploymentOption.No role.user.access.ids="" role.group.access.ids="" } # # SubSection 1.0.4 # BindJndiForEJBNonMessageBinding # Section. taskName and lines marked as "#readonly" should # not be edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # #Properties # taskName=BindJndiForEJBNonMessageBinding row0={ EJBModule="My EJB Module" #readonly EJB=myEjb #readonly uri=myEjbModule.jar,META-INF/ejb-jar.xml #readonly JNDI=myEjb localHomeJndi="" remoteHomeJndi="" } # # SubSection 1.0.5 # MapEJBRefToEJB Section. taskName and # lines marked as "#readonly" should not be edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # #Properties # taskName=MapEJBRefToEJB row0={ module="My EJB Module" #readonly EJB=myEJB #readonly uri=MyejbModule.jar,META-INF/ejb-jar.xml #readonly referenceBinding=myEJB #readonly class=com.ibm.defaultapplication.Increment #readonly JNDI=myejb } # # SubSection 1.0.6 # DataSourceFor20EJBModules Section. # taskName and lines marked as "#readonly" should not be # edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # #Properties # taskName=DataSourceFor20EJBModules row0={ EJBModule="My EJB Module" #readonly uri=myEjbModule.jar,META-INF/ejb-jar.xml #readonly JNDI=MyDatasource resAuth=cmpBinding.perConnectionFactory login.config.name="" auth.props="" dataSourceProps="" } # # SubSection 1.0.7 # DataSourceFor20CMPBeans Section. # taskName and lines marked as "#readonly" should not be # edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=DataSourceFor20CMPBeans row0={ EJBModule="My EJB Module” #readonly EJB=MyEjb #readonly uri=MyEjbModule.jar,META-INF/ejb-jar.xml #readonly JNDI=MyDatasource resAuth=cmpBinding.perConnectionFactory login.config.name="" auth.props="" } # # SubSection 1.0.8 # MapWebModToVH Section. taskName and # lines marked as "#readonly" should not be edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # Properties # taskName=MapWebModToVH row0={ webModule="My Web Application" #readonly uri=myWebModule.war,WEB-INF/web.xml #readonly virtualHost=default_host } # # SubSection 1.0.9 # CtxRootForWebMod Section. taskName and # lines marked as "#readonly" should not be edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # Properties # taskName=CtxRootForWebMod row0={ webModule="My Web Application" #readonly uri=myWebModule.war,WEB-INF/web.xml #readonly web.contextroot=/ } # # SubSection 1.0.10 # MapSharedLibForMod Section. # taskName and lines marked as "#readonly" should not be # edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=MapSharedLibForMod row0={ module=myApp” #readonly uri=META-INF/application.xml #readonly sharedLibName="" } row1={ module="My Web Application" #readonly uri=MyWebModule.war,WEB-INF/web.xml #readonly sharedLibName="" } # # SubSection 1.0.11 # JSPReloadForWebMod Section. taskName # and lines marked as "#readonly" should not be # edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=JSPReloadForWebMod row0={ webModule="My Web Application" #readonly uri=MyWebModule.war,WEB-INF/web.xml #readonly jspReloadEnabled=AppDeploymentOption.Yes jspReloadInterval=10 } # # SubSection 1.0.35 # SharedLibRelationship Section. # taskName and lines marked as "#readonly" should not be # edited. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=SharedLibRelationship row0={ module=myApp #readonly uri=META-INF/application.xml #readonly relationship="" matchTarget=AppDeploymentOption.Yes } row1={ module="My Web Application" #readonly uri=MyWebModule.war,WEB-INF/web.xml #readonly relationship="" matchTarget=AppDeploymentOption.Yes } EnvironmentVariablesSection # # Environment Variables # applicationName=myApp cellName=myCell nodeName=myNode serverName=myServerUpdate a single file in a deployed enterprise application
The example properties add a single file to a deployed application:
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=hello Update=true operationType=add contentType=file contentURI=test.war/com/ibm/addMe.jsp contentFile=/temp/addMe.jspRemove a single file from a deployed enterprise application
The example properties delete a single file from a deployed application:
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=hello Update=true operationType=delete contentType=file contentURI=test.war/com/ibm/addMe.jspUpdate a single module in a deployed enterprise application
The example properties add a single module to a deployed application:
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=hello Update=true operationType=add contentType=moduleFile #contextRoot=”/mywebapp” # required for web module only contentURI=Increment.jar contentFile=/apps/app1/Increment.jar deployEJB=falseRemove a single module from a deployed enterprise application
The example properties delete a single module from a deployed application:
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=hello Update=true operationType=delete contentType=moduleFile contentURI=test.warReplace, add, or delete multiple files of a deployed enterprise application
This option specifies to update multiple files of an installed application by uploading a compressed file. Depending on the contents of the compressed file, a single use of this option can replace files in, add new files to, and delete files from the installed application. Each entry in the compressed file is treated as a single file and the path of the file from the root of the compressed file is treated as the relative path of the file in the installed application.
To replace a file, a file in the compressed file must have the same relative path as the file to be updated in the installed application.
To add a new file to the installed application, a file in the compressed file must have a different relative path than the files in the installed application.
The relative path of a file in the installed application is formed by concatenation of the relative path of the module, if the file is inside a module, and the relative path of the file from the root of the module separated by a forward slash (/).
To remove a file from the installed application, specify metadata in the compressed file using a file named META-INF/ibm-partialapp-delete.props at any archive scope. The ibm-partialapp-delete.props file must be an ASCII file that lists files to be deleted in that archive with one entry for each line. The entry can contain a string pattern such as a regular expression that identifies multiple files. The file paths for the files to be deleted must be relative to the archive path that has the META-INF/ibm-partialapp-delete.props file.
For more information about the metadata .props file to include in compressed files, see the "Replace, add, or delete multiple files" section in Preparing for application update settings.
The example properties use the myAppPartial.zip compressed file to update a deployed application named hello:
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=hello Update=true operationType=update contentType=partialapp contentFile=/temp/MyApp/myAppPartial.zipReplace the entire deployed enterprise application
The example properties update the entire deployed application:
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=hello Update=true operationType=update contentType=app contentFile=/apps/app1/newApp1.ear useDefaultBindings=trueUninstall an application from a deployment target
The example properties uninstall a deployed application:
# # Header # ResourceType=Application ImplementingResourceType=Application DELETE=true # Properties Name=helloEdit the deployment options of a deployed application
The example properties update the deployment options of a deployed application:
# # Header # ResourceType=Application ImplementingResourceType=Application # Properties Name=!{applicationName} # # SubSection 1.0.1 # AppDeploymentOptions Section. taskName # and row0 should not be edited. row0 contains column names # for the task. # ResourceType=Application ImplementingResourceType=Application ResourceId=Deployment=!{applicationName} # # # Properties # taskName=AppDeploymentOptions row1={$(APP_INSTALL_ROOT)/$(CELL) AppDeploymentOption.Yes AppDeploymentOption.No AppDeploymentOption.No AppDeploymentOption.No "" off .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 "WASX.SERV1 [x0617.27]" AppDeploymentOption.No AppDeploymentOption.No} mutables={true true true true true true true true false true true} row0={installed.ear.destination distributeApp useMetaDataFromBinary createMBeansForResources reloadEnabled reloadInterval validateinstall filepermission buildVersion allowDispatchRemoteInclude allowServiceRemoteInclude} #readonly # EnvironmentVariablesSection # # #Environment Variables applicationName=newhelloEdit web module deployment properties
The example properties edit the deployment properties of a web module:
# # WebModuleDeployment # ResourceType=WebModuleDeployment ImplementingResourceType=Application ResourceId=Cell=!{cellName}:Deployment=!{applicationName}:ApplicationDeployment= :WebModuleDeployment=uri#web.war # #Properties # startingWeight=90000 #integer,required,default(1) deploymentId=1 #required classloaderMode=PARENT_FIRST ENUM(PARENT_FIRST|PARENT_LAST),default(PARENT_FIRST)altDD=null uri=web.war #required #applicationDeployment=Cell=!{cellName}:Deployment=!{applicationName}:ApplicationDeployment= #ObjectName(ApplicationDeployment) EnvironmentVariablesSection # # #Environment Variables cellName=myCell applicationName=myApp
If the properties file deploys an application or module, test the deployed application or module. For example, enter the URL for a deployed application in a web browser and examine the performance of the application.
If the deployment is not successful, read messages in the SystemOut.log file, fix the error condition, and add the properties file to the monitored directory again.
Related
Install enterprise application files by adding them to a monitored directory
Use application properties files to install, update, and delete enterprise application files
Set monitored directory deployment values
Install enterprise application files
Uninstall enterprise application files by dragging them from a monitored directory
Troubleshoot applications with HPEL
Reference:
Prepare for application update settings
Directory conventions
Related information:
Rational Application Developer documentation