WAS v8.5 > Deploy applications > Deploy enterprise applications

Install enterprise modules with JSR-88

We can install Java EE modules on an application server provided by a WebSphere Application Server product using the Java EE Application Deployment API specification (JSR-88).

Deprecated feature: Application installation using the Java EE Application Deployment API specification (JSR-88) was deprecated in WAS v8.0. Use another option to deploy applications to a server. The closest option to using the Java EE Deployment API is using JMX MBean programming. For information on deployment options, see "Ways to install enterprise applications or modules..

JSR-88 defines standard APIs to enable deployment of Java EE applications and stand-alone modules to Java EE product platforms. The Java EE Application Deployment specification v1.1 is available at http://java.sun.com/j2ee/tools/deployment/reference/docs/index.html as part of the J2EE 1.4 Application Server Developer Release.

Read about JSR-88 and APIs used to manage applications at http://java.sun.com/j2ee/tools/deployment/. JSR-88 defines a contract between a tool provider and a platform that enables tools from multiple vendors to configure, deploy and manage applications on any Java EE product platform. The tool provider typically supplies software tools and an integrated development environment (IDE) for developing and assembly of Java EE application modules. The Java EE platform provides application management functions that deploy, undeploy, start, stop, and otherwise manage Java EE applications.

WAS is a Java EE specification-compliant platform that implements the JSR-88 APIs. To deploy (install) Java EE modules on an application server provided by the WAS platform.

  1. Code a Java program that can access the JSR-88 DeploymentManager class for the product.

    1. Write code that finds the JAR manifest attribute J2EE-DeploymentFactory-Implementation-Class.

      Under JSR-88, your code finds the DeploymentFactory using the JAR manifest attribute J2EE-DeploymentFactory-Implementation-Class. The following product application management JAR files contain this attribute and provide support.

      JAR files containing the manifest attribute. Enable your code to find the DeploymentFactory using the JAR manifest attribute.

      Environment JAR file containing the manifest attribute
      Application server app_server_root/plugins/com.ibm.ws.admin.services.jar
      Application client app_client_root/plugins/com.ibm.ws.j2ee.client.jar
      Thin application client app_client_root/runtimes/com.ibm.ws.admin.client_8.0.0.jar

      After your code finds the DeploymentFactory, the deployment tool can create an instance of the WebSphere DeploymentFactory and register the instance with its DeploymentFactoryManager.

      Example code for the application server environment follows. The example code requires that we use the development kit shipped with the product or use the pluggable client for deployment of stand-alone modules. See WAS detailed system requirements at http://www.ibm.com/support/docview.wss?rs=180&uid=swg27006921 for information on supported development kits.

      import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
      import javax.enterprise.deploy.spi.DeploymentManager;
      import javax.enterprise.deploy.spi.factories.DeploymentFactory;
      import java.util.jar.JarFile;
      import java.util.jar.Manifest;
      
      // Get the DeploymentFactory implementation class from the MANIFEST.MF file.
      File jsr88Jar = new File(wasHome + "/plugins/com.ibm.ws.admin.services.jar");
      JarFile jarFile = new JarFile(jsr88Jar);
      Manifest manifest = jarFile.getManifest();
      Attributes attributes = manifest.getMainAttributes();
      String key = "J2EE-DeploymentFactory-Implementation-Class";
      String className = attributes.getValue(key);
      // Get an instance of the DeploymentFactoryManager
      DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
      
      // Create an instance of the WAS DeploymentFactory.
      Class deploymentFactory = Class.forName(className);
      DeploymentFactory deploymentFactoryInstance =
         (DeploymentFactory) deploymentFactory.newInstance();
      
      // Register the DeploymentFactory instance with the DeploymentFactoryManager.
      dfm.registerDeploymentFactory(deploymentFactoryInstance);
      
      // Provide WAS URI, user ID, and password.
      // For more information, see the step that follows.
      wsDM = dfm.getDeploymentManager(
         "deployer:WebSphere:myserver:8880", null, null);
    2. Write code that accesses the DeploymentManager instance for the product.

      WAS v8.5 URI for deployment has the following format:

        "deployer:WebSphere:host:port"

      The example in the previous step, "deployer:WebSphere:myserver:8880", tries to connect to host myserver at port 8880 using the SOAP connector, which is the default.

      We can specify an Internet Protocol v6 (IPv6) address for the host element in the URI for deployment. Enclose the IPv6 address in square brackets ([]); for example:

        "deployer:WebSphere:[IPv6_address]:port"

      Also, we can add an optional parameter, connectorType, to the URI for deployment. For example, to use the RMI connector to access myserver, code the URI as follows:

        "deployer:WebSphere:myserver:2809?connectorType=RMI"

  2. Optional: Code a Java program that can customize or deploy Java EE applications or modules using the JSR-88 support provided by the product.
  3. Start the deployed Java EE applications or stand-alone Java EE modules using the JSR-88 API used to start applications or modules.

Test the deployed applications or modules. For example, point a web browser at the URL for a deployed application and examine the performance of the application. If necessary, update the application.


Related concepts:

Ways to install enterprise applications or modules


Related


Install enterprise application files
Customize modules using DConfigBeans


Reference:

Directory conventions


Related information:

Java EE Application Deployment Specification
WAS detailed system requirements


+

Search Tips   |   Advanced Search