You can install Java 2 Platform, Enterprise Edition (J2EE) modules on an application server provided by a WebSphere Application Server product using the J2EE Deployment API Specification (JSR-88).
JSR-88 defines standard application programming interfaces (APIs) to enable deployment of J2EE applications and stand-alone modules to J2EE product platforms. The J2EE Deployment Specification Version 1.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 J2EE product platform. The tool provider typically supplies software tools and an integrated development environment (IDE) for developing and assembly of J2EE application modules. The J2EE platform provides application management functions that deploy, undeploy, start, stop, and otherwise manage J2EE applications.
WebSphere Application Server is a J2EE 1.4 specification-compliant platform that implements the JSR-88 APIs. Complete the following steps to deploy (install) J2EE modules on an application server provided by the WebSphere Application Server platform.
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; // Get the DeploymentFactory implementation class from the MANIFEST.MF file. JarFile wjmxappJar = new JarFile(new File(wasHome + "/lib/wjmxapp.jar")); java.util.jar.Manifest manifestFile = wjmxappJar.getManifest(); Attributes attributes = manifestFile.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 WebSphere Application Server DeploymentFactory. Class deploymentFactory = Class.forName(className); DeploymentFactory deploymentFactoryInstance = (DeploymentFactory) deploymentFactory.newInstance(); // Register the DeploymentFactory instance with the DeploymentFactoryManager. dfm.registerDeploymentFactory(deploymentFactoryInstance); // Provide WebSphere Application Server URL, user ID, and password. // For more information, see the step that follows. wsDM = dfm.getDeploymentManager( "deployer:WebSphere:myserver:8880", null, null);
"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.
The URL for deployment can have an optional parameter connectorType. For example, to use the RMI connector to access myserver, code the URL as follows:
"deployer:WebSphere:myserver:2809?connectorType=RMI"
Related tasks
Installing application files
Customizing modules using DConfigBeans
Related information
J2EE Application Deployment Specification