Deploy enterprise applications into servers

This page discusses - Deploy enterprise applications into servers

Deploy enterprise applications into servers

Deploy enterprise applications into servers

Installing a new application

To install an enterprise application to a WebSphere Application Server configuration, you can use the administrative console or the wsadmin tool. The steps below describe how to use the administrative console to install an application, EJB component, or Web module.

Note: After you start performing the steps below, click Cancel to exit if you decide not to install the application. Do not simply move to another administrative console page without first clicking Cancel on an application installation page.

  1. Click Applications > Install New Application in the console navigation tree. The first of two Preparing for application install pages is shown.

  2. On the first Preparing for application install page:

    1. Specify the full path name of the source application file (.ear file otherwise known as an EAR file). The EAR file that you are installing can be either on the client machine (the machine that runs the Web browser) or on the server machine (the machine to which the client is connected). If you specify an EAR file on the client machine, then the administrative console uploads the EAR file to the machine on which the console is running and proceeds with application installation. You can also specify a standalone WAR or JAR file for installation.

    2. If you are installing a standalone WAR file, specify the context root.

    3. Click Next.

  3. On the second Preparing for application install page:

    1. Select whether to generate default bindings. Using the default bindings causes any incomplete bindings in the application to be filled in with default values. Existing bindings are not altered. You can customize default values used in generating default bindings. For example, you can specify JNDI prefix for all the EJB files in EJB modules, default data source and connection factory settings for EJB modules, virtual host for web modules, and so on.

    2. Click Next. The Install New Application pages are now shown. If you chose to generate default bindings, you can proceed to the Summary step (step 23).

  4. On the Step: Provide options to perform the installation panel, provide values for the following settings specific to WebSphere Application Server. Default values are used if you do not specify a value.

    1. For Pre-compile JSP, specify whether to precompile JSP files as a part of installation. The default is not to precompile JSP files. The precompileJSPs flag, which is specified as preCompileJSPs="true" in the IBM extension file ibm-web-exit.ami of a WAR module, is ignored during deployment and JSP files are not precompiled. The flag is set by application assembly or development tools such as WebSphere Studio Application Developer and Assembly Toolkit.

    2. For Directory to Install Application, specify the directory to which the application EAR file will be installed. The default value is the value of APP_INSTALL_ROOT/cell_name, where the APP_INSTALL_ROOT variable is install_root/installedApps; for example, C:\WebSphere\AppServer\installedApps\cell_name.

    3. For Distribute Application, specify whether WebSphere Application Server expands or deletes application binaries in the installation destination. The default is to enable application distribution. As a result, when you save changes in the console, application binaries for newly installed applications are expanded to the directory specified. The binaries are also deleted when you uninstall and save changes to the configuration. If you disable this option, then you must ensure that the application binaries are expanded appropriately in the destination directories of all nodes where the application is expected to run.

      Note: If you disable this option and you do not copy and expand the application binaries to the nodes, a later saving of the configuration does not move the application binaries to the nodes for you.

    4. For Use Binary Configuration, specify whether the application server uses the binding, extensions, and deployment descriptors located with the application deployment document, the deployment.xml file (default), or those located in the EAR file. The default is not to use the binary configuration.

    5. For Deploy EJBs, specify whether the EJBDeploy tool runs during application installation. The tool generates code needed to run EJB files. The default is not to run the EJBDeploy tool. You must enable this setting if the EAR file was assembled using the Application Assembly (AAT) tool and the EJBDeploy tool was not run during assembly, if the EAR file was not assembled using the AAT tool, or if the EAR file was assembled using versions of the Application Assembly Tool (AAT) previous to Version 5. Note that enabling this setting might cause the installation program to run for several minutes.

    6. For Application Name, name the application. Application names must be unique within a cell and cannot contain characters that are not allowed in object names.

    7. For Create MBeans for Resources, specify whether to create MBeans for various resources (such as servlets or JSP files) within an application when the application is started. The default is to create MBean instances.

    8. For Enable class reloading, specify whether to enable class reloading when application files are updated. The default is not to enable class reloading.

      For EJB modules or any non-Web modules, enabling class reloading sets reloadEnabled to true in the deployment.xml file for the application. If an application's class definition changes, the application server run time stops and starts the application to reload application classes.

      For Web modules such as servlets and JavaServer page (JSP) files, a Web container reloads a Web module only when the IBM extension reloadingEnabled in the ibm-web-ext.xmi file is set to true. You can set reloadingEnabled to true when editing your Web module's extended deployment descriptors in an assembly tool.

      To disable reloading of a Web module, set the IBM extension reloadingEnabled in the ibm-web-ext.xmi file to false. Or, if the Web module has the IBM extension reloadingEnabled in the ibm-web-ext.xmi file set to true, enable class loading, and set the Reload Interval property to zero (0).

    9. For Reload Interval, specify the number of seconds to scan the application's file system for updated files. The default is the value of the reload interval attribute in the IBM extension (META-INF/ibm-application-ext.xmi) file of the EAR file. To enable reloading, specify a value greater than zero (for example, 1 to 2147483647). To disable reloading, specify zero (0).

      The reload interval specified here overrides the value specified in the IBM extensions for each Web module in the EAR file (which in turn overrides the reload interval specified in the IBM extensions for the application in the EAR file). This setting takes effect only if class reloading is enabled.

  5. If your application uses EJB modules, on the Step: Provide JNDI Names for Beans panel, specify a JNDI name for each enterprise bean in every EJB module. You must specify a JNDI name for every enterprise bean defined in the application. For example, for the EJB module MyBean.jar, specify MyBean.

  6. If your application uses EJB modules that contain Container Managed Persistence (CMP) beans that are based on the EJB 1.x specification, for Step: Provide default datasource mapping for modules containing 1.x entity beans, specify a JNDI name for the default data source for the EJB modules. The default data source for the EJB modules is optional if data sources are specified for individual CMP beans.

  7. If your application has CMP beans that are based on the EJB 1.x specification, for Step: Map datasources for all 1.x CMP, specify a JNDI name for data sources to be used for each of the 1.x CMP beans. The data source attribute is optional for individual CMP beans if a default data source is specified for the EJB module that contains CMP beans. If neither a default data source for the EJB module nor a data source for individual CMP beans are specified, then a validation error displays after you click Finish (Step 23) and the installation is cancelled.

  8. If your application defines EJB references, for Step: Map EJB references to beans, specify JNDI names for enterprise beans that represent the logical names specified in EJB references. Each EJB reference defined in the application must be bound to an EJB file before clicking Finish on the Summary panel. 0

  9. If your application defines resource references, for Step: Map resource references to resources, specify JNDI names for the resources that represent the logical names defined in resource references. Each resource reference defined in the application must be bound to a resource defined in your WebSphere Application Server configuration before clicking on Finish on the Summary panel.

  10. If your application uses Web modules, for Step: Map virtual hosts for web modules, select a virtual host from the list that should map to a Web module defined in the application. The port number specified in the virtual host definition is used in the URL that is used to access artifacts such as servlets and JSP files in the Web module. Each Web module must have a virtual host to which it maps. Not specifying all needed virtual hosts will result in a validation error displaying after you click Finish on the Summary panel.

  11. On the Step: Map modules to application servers panel, for every module select a target server or a cluster from the Clusters and Servers list. Select the check box beside Module to select all of the application modules or select individual modules. 1

  12. If the application has security roles defined in its deployment descriptor then, for Step: Map security roles to users/groups, specify users and groups that are mapped to each of the security roles. Select the check box beside Role to select all of the roles or select individual roles. For each role, you can specify if predefined users such as Everyone or All Authenticated users are mapped to it. To select specific users or groups from the user registry:

    1. Select a role and click Lookup users or Lookup groups.

    2. On the Lookup users/groups panel shown, enter search criteria to extract a list of users or groups from the user registry. 2

    3. Select individual users or groups from the results displayed.

    4. Click OK to map the selected users or groups to the role selected on the Step: Map security roles to users/groups panel.

  13. If the application has Run As roles defined in its deployment descriptor, for Step: Map RunAs roles to user, specify the Run As user name and password for every Run As role. Run As roles are used by enterprise beans that must run as a particular role while interacting with another enterprise bean. Select the check box beside Role to select all of the roles or select individual roles. After selecting a role, enter values for the user name, password, and verify password and click Apply. 3

  14. If your application contains EJB 1.x CMP beans that do not have method permissions defined for some of the EJB methods, for Step: Ensure all unprotected 1.x methods have the correct level of protection, specify if you want to leave such methods unprotected or assign protection with deny all access.

  15. If your application contains message driven enterprise beans, for Step: Provide Listener Ports for messaging beans, provide a listener port name for every message driven bean. If a name is not specified for each bean, then a validation error displays after you click on Finish on the Summary panel.

  16. If your application uses EJB modules that contain CMP beans that are based on the EJB 2.0 specification, for Step: Provide default datasource mapping for modules containing 2.0 entity beans, specify a JNDI name for the default data source and the type of resource authorization to be used for the default data source for the EJB modules. The default data source for EJB modules is optional if data sources are specified for individual CMP beans. 4

  17. If your application has CMP beans that are based on the EJB 2.0 specification, on the Step: Map datasources for all 2.0 CMP panel, for each of the 2.0 CMP beans specify a JNDI name and the type of resource authorization for data sources to be used. The data source attribute is optional for individual CMP beans if a default data source is specified for the EJB module that contains CMP beans. If neither a default data source for the EJB module nor a data source for individual CMP beans are specified, then a validation error is shown after you click Finish and installation is cancelled.

  18. If your application contains EJB 2.0 CMP beans that do not have method permissions defined in the deployment descriptors for some of the EJB methods, on the Step: Ensure all unprotected 2.0 methods have the correct level of protection panel, specify whether you want to assign a specific role to the unprotected methods, add the methods to the exclude list, or mark them as unchecked. Methods added to the exclude list are marked as uncallable. For methods marked unchecked no authorization check is performed prior to their invocation.

  19. If the Deploy EJBs setting is enabled on the Provide options to perform the installation panel, then you can specify options for the EJBDeploy tool on the Step: Provide options to perform the EJB Deploy panel. On this panel, you can specify extra class path, rmic options, database types, and database schema names to be used while running the EJBDeploy tool. The tool is run on the EAR file during installation after you click Finish. 5

  20. If your application contains resource environment references, for Step: Mapping Resource Environment References to Resources, specify JNDI names of resources that map to the logical names defined in resource environment references. If each resource environment reference does not have a resource associated with it, a validation error is shown after you click Finish.

  21. If your application defines Run-As Identity as System Identity, for Step: Replacing RunAs System to RunAs Roles, you can optionally change it to Run-As role and specify a user name and password for the Run As role specified. Selecting System Identity implies that the invocation is done using the WebSphere Application Server security server ID and should be used with caution as this ID has more privileges.

  22. If your application has resource references that map to resources that have an Oracle database doing backend processing, for Step: Specify the isolation level for Oracle type provider, specify or correct the isolation level to be used for such resources when used by the application. Oracle databases support ReadCommitted and Serializable isolation levels only. 6

  23. On the Summary panel, verify the cell, node, and server onto which the application modules will install. Beside the Cell/Node/Server option, click Click here and verify the settings. Then click Finish.

    Tip: After clicking Finish, if you receive an OutOfMemory exception and the source application file does not install, your system might not have enough memory or your application might have too many modules in it to install successfully onto the server. If lack of system memory is not the cause of the exception, package your application again so the .ear file has fewer modules. If lack of system memory and the number of modules are not the cause of the exception, check the options you specified on the Java Virtual Machine page of the application server running the administrative console. Then, try installing the application file again.

  24. Associate any shared libraries that the application needs to the application. 7

  25. Click Save on the administrative console taskbar to save the changes to your configuration. The application is registered with the administrative configuration and application files are copied to the target directory, which is install_root/installedApps/cell_name by default or the directory that you designate. For the single-server (base) installation, application files are copied to the destination directory when you click Save; for the Network Deployment installation, files are copied to remote nodes when the configuration on the deployment manager synchronizes with the configuration on individual nodes.

  26. Start the application.

  27. Test the application. For example, point a Web browser at the URL for the deployed application and examine the performance of the application. If necessary, update the application. 8

Visit http://java.boot.by  for the updates.

Tutorials

  1. Appendix A. Additional materials
  2. WSAD 5.0 Practicing for IBM Test 000-287 Mind Map
  3. Deploy enterprise applications into servers
  4. Chapter 6. Assemble enterprise applications and deploy them in IBM WebSphere Application Server
  5. Configure resource and security-role references
  6. Design and develop custom tags
  7. Chapter 4. Demonstrate understanding of database connectivity and messaging within IBM WebShpere Application Server
  8. Chapter 5. EJB transactions
  9. Design and develop message-driven EJBs
  10. Design and develop entity EJBs
  11. Validate operational parameters of application server to support the enterprise application
  12. Chapter 1. Design, build and test reusable enterprise components
  13. Access container and server services from enterprise components
  14. Part I. Exam Objectives
  15. Explain implications of resource management on application design and implementation
  16. Manage end-user state and understand performance tradeoffs of using HTTP sessions
  17. Chapter 7. Validate, tune and troubleshoot an application within an IBM WebSphere Application Server environment
  18. Implement mechanisms for efficient inter-component calls
  19. IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide
  20. Chapter 3. Develop clients that access the enterprise components
  21. Implement Java clients calling Web Services
  22. Configure JMS connection factories and destinations
  23. Design, develop and test JSPs
  24. Use JTA to control transaction demarcation
  25. Manipulate transactional behavior of EJBs using deployment descriptors
  26. Implement mechanisms which support loose coupling between clients and components
  27. Identify misbehaving application components
  28. Preface
  29. WSAD 5.0 Practicing for IBM Test 000-287
  30. Part II. Appendixes
  31. Interact with connection pools to obtain and release connections
  32. Describe the effects of a server failure on the application
  33. Test and debug enterprise components
  34. Chapter 2. Design, build and test web components
  35. Chapter 2. Design, build and test web components