Chapter 9: Importing and Exporting Application Components  Deploying Web applications

Chapter 9: Importing and Exporting Application Components

Deploying packages and components

Components must be archived as part of the package where they are installed. You can archive in two formats:

Importing and exporting components in EAServer JAR format

EAServer Manager allows you to create an archive file containing component definitions and implementation files for all components in a package or a single component. You can export archive files from packages on your development server and import them to your production server. If the JAR file contains a single component, it must be installed to a package with the same name as the one from which it was exported.

StepsDeploying packages between servers using archive files

  1. Start EAServer Manager on the test server host and connect to the test server.

  2. Optionally, configure the package properties to specify the list of additional files to be included in the package archive. In the Package Properties window, you can use the Additional Files tab to set the property, as described in the online help.

    By default, all component implementation files and required stub files are included in the archive. You may want to include other files, such as project descriptions, client applets, and HTML pages. You can specify additional files either by setting the package or component properties or when generating the package archive.

  3. Export an archive of the application’s EAServer packages. This step creates a Java archive (JAR) file containing the component definition files and implementation files. “Exporting a package archive” describes this step in detail.

  4. Copy the JAR file to the production server.

  5. Start EAServer Manager on the production server host, and connect to the production server.

  6. Import the JAR file containing the package archive into the production server. “Importing a package archive” describes this step in detail.

  7. If you have copied the package between host machines that have different architectures, recompile the components to run on the new architecture.

StepsExporting a package archive

  1. Start EAServer Manager, and connect to the server where the package is installed.

  2. Highlight the package you are exporting.

  3. Select File | Export | EAServer JAR.

  4. The Export dialog box appears.

    For each C/C++ component in your package, provide the name of the corresponding DLL or shared-library file. No input is required for Java components.

  5. Click the Misc. Information button to add any other files that you want to include with the package. These files can include HTML files, project files, and so on.

    Use the Browse, Add, and OK buttons to add other files to the JAR file. To delete a miscellaneous file, highlight the file and click Delete. Click Done when all the files you want to include are listed in the dialog box.

  6. Click OK.

The exporter locates the Java class and C/C++ shared library files and combines them with the miscellaneous files you selected into a JAR file.

StepsImporting a package archive

  1. Copy the JAR file containing the package definition to the host machine for the target server.

  2. Start EAServer Manager and connect to the target server.

  3. Expand the Packages folder and verify that the package to be imported does not already exist. If it does, select it and delete the package.

  4. Highlight the packages folder, and select File | Import.

  5. The Import dialog box appears:

  6. Click Import.

StepsExporting a component as an EAServer JAR file

  1. Highlight the icon for the component you are exporting. .

  2. Select File | Export | EAServer JAR.

  3. The Export dialog box appears. Enter the full path of the directory where the JAR file is to be created.

  4. Click OK. EAServer Manager creates the file name component.jar, where component is the name of the selected component.

StepsImporting a single component from an EAServer JAR file

If the JAR file contains a single component, it must be installed in a package with the same name as the one where it was originally installed. Create this package if necessary. Import the component as follows:

  1. Highlight the package from which the component was exported.

  2. Choose File | Deploy | EAServer JAR.

  3. Use the Browse button to select the JAR file, or type the full path to the file.

  4. Click OK to begin importing.

Importing and exporting packages in EJB-JAR format

An EJB-JAR file contains the implementation classes, interface classes, and deployment descriptor for one or more beans. You can use a Java development tool such as Sybase PowerJ to define and develop beans and create an EJB-JAR file. You can import JAR files in the EJB 1.0, EJB 1.1, or EJB 2.0 formats. EAServer Manager reads the JAR file and creates a package containing a component for each bean in the JAR file.

NotePowerJ deploys Enterprise JavaBeans directly to EAServer If you are developing in PowerJ, use the Enterprise JavaBeans Deployment Wizard to install EJB components to EAServer. If using another IDE, use EAServer Manager to import the bean as described below.

StepsImporting an EJB 1.1 or 2.0 JAR file

  1. Start EAServer Manager if it is not already running, and connect to the server where you want to install the component.

  2. Highlight the top-level Packages folder. Choose File | Deploy | EJB JAR.

  3. Enter the path to the EJB-JAR file.

  4. Choose the Deployment Strategy from the options described in Table 9-1.

    Table 9-1: Deployment strategy options

    Deployment strategy


    Full deployment

    The importer generates IDL for every class defined in the JAR, regardless of whether the interface already exists. Use this option when deploying components for the first time or when you want to restore IDL types that have been changed or deleted.

    Incremental deployment

    The importer generates IDL only when the Java types and interfaces have changed from the last time it was imported. The following are compared:

    • Methods

    • Fields

    • Interfaces

    • Superclass

    Use this option if you redeploying components and have changed some interfaces or parameter types.

    Optimistic deployment

    Similar to Incremental, except that the check for changed classes in each package ends if the first class comparison indicates no change. Use this option if you are redeploying components, and have changed only the implementation classes.

  5. Configure the Deployment Options:

  6. Click Finish.

EAServer Manager creates a new package that contains a component for each bean defined in the JAR file, printing status messages and warnings to the Deploy Wizard. The new package has the same name as the EJB JAR display name. If there is no display name, the new package has the same name as the JAR file. For each bean in the EJB-JAR, EAServer creates an EJB component with the same name as the ejb-name element in the EJB-JAR deployment descriptor.

NoteHome names for imported EJB components EAServer sets an imported bean’s home name to the EAServer default, package/component, where package is the EAServer Manager package name, and component is the EAServer Manager component name.

NoteUse the status dialog as a to-do list In the deployment status dialog box, EAServer Manager display warnings for each setting that requires further attention before running the application. You can copy and paste this text to a text editor to use as a to-do list.

Exporting EJB-JAR files

You can create an EJB-JAR file that contains the Java classes and deployment descriptors for the EJB components installed in an EAServer package. The JAR file can be deployed to another EAServer installation or any EJB compatible server.

You can export EJB-JAR files in two formats:

NoteUse synchronization for deploying beans between servers The EAServer synchronization feature can also be used to deploy components from one EAServer installation to another. Synchronization is simpler than importing and exporting JAR files, but the source server must be able to connect to the target server. If you use synchronization, you will avoid the need to reconfigure JNDI resource references on the target server for EJB 2.0 or 1.1 components.

StepsExporting an EJB-JAR file

  1. Highlight the EAServer package to export and choose File | Export, then choose EJB 1.0 JAR or EJB JAR.

  2. Enter the path and file name for the new JAR file and click Next.

  3. Optionally deselect the Export with EAServer XML Configuration File option if you do not want the archive to include an EAServer XML configuration file.

  4. EAServer Manager creates the JAR file, displaying status messages in the Export wizard.

Copyright © 2005. Sybase Inc. All rights reserved. Deploying Web applications