Chapter 10 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 packages in Jaguar JAR format

Jaguar Manager allows you to create an archive file containing component definitions and implementation files for all components in a package. You can export archive files from packages on your development server and import them to your production server.

Steps Deploying packages between servers using archive files

  1. Start Jaguar 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 All Properties tab to set the com.sybase.jaguar.package.files property, as described in com.sybase.jaguar.package.files.

    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 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 Jaguar 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.

Steps Exporting a package archive

  1. Start Jaguar Manager, and connect to the server where the package is installed.
  2. Highlight the package you are exporting.
  3. Select File | Export JAR File.
  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.

Steps Importing a package archive

  1. Copy the JAR file containing the package definition to the host machine for the target server.
  2. Start Jaguar 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.

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. Jaguar Manager reads the JAR file and creates a package containing a component for each bean in the JAR file.

Note  

PowerJ 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 Jaguar Manager to import the bean as described below.

Steps Importing an EJB 1.1 or 2.0 JAR file

  1. Start Jaguar 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 10-1.
    Table 10-1: Deployment strategy options
    Deployment strategy Specifies
    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.

Jaguar 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.

Note  

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

Note  

Use the status dialog as a to-do list In the deployment status dialog box, Jaguar 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:

Note  

Use 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.

Steps Exporting 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. Jaguar Manager creates the JAR file, displaying status messages in the Export wizard.

 


Copyright © 2002 Sybase, Inc. All rights reserved.