
Chapter 10 Importing and Exporting Application Components
Deploying J2EE applications
You can export applications from Jaguar Manager to deploy
them on another server. EAServer supports two archive formats for
applications:
- J2EE enterprise
archive (EAR) The EAR format
is the standard for servers that support J2EE. This format allows
portability to other vendor's J2EE servers, but does not
support component types other than EJB or container-specific information
such as:
- Role mappings
- Resource references
- EJB references to components that are not installed
with the EAR file, or when more than one bean uses the same home
and remote interfaces. It is impossible to infer EJB references
if more than one bean uses the home and remote interfaces specified
by the reference properties in the deployment descriptor. After
importing an EJB-JAR file that contains multiple beans that use
the same home and remote interfaces, view the EJB Reference properties
to verify that the correct bean is invoked.
- Environment properties
You can optionally include EAServer XML configuration files
to preserve the configuration of these properties, as described
in "Using EAServer configuration
files in J2EE archives".
- Jaguar JAR For
exporting between EAServer 3.6 or later servers. This format, while
proprietary, preserves all information in the application and supports
component types other than EJB. When importing, EJB references,
resource references, and role mappings are preserved. You must ensure
that the referenced items are in place before you run the imported
application.
Consider synchronization instead of archives If you are deploying between EAServer installations, you may
find synchronization easier than exporting and importing archives.
Synchronization replicates an application directly between servers.
See Chapter 6, "Clusters and Synchronization"for more
information.
Exporting an application
- Expand the top-level Applications folder.
- Highlight the application to export. If you are exporting
an EAR file, choose File | Export | J2EE EAR.
If you are exporting a Jaguar JAR, choose File | Export | Jaguar
JAR.
- In the Export wizard:
- Enter the name of the EAR or JAR
file to create including the full directory path and the .ear or .jar extension.
- If exporting in EAR format, optionally deselect the
Export with EAServer XML Configuration File option if you do not
want the archive to include an EAServer XML configuration file.
- Click Next. Jaguar Manager creates the EAR or JAR file,
displaying status messages in the Export wizard.
Importing an application
- Highlight the top-level Applications folder.
If you are importing an EAR file, choose File | Deploy | J2EE
EAR. Otherwise, choose File | Deploy | Jaguar
JAR.
- Enter the path to the EAR or JAR file.
- If importing an EAR file, choose a deployment strategy. Table 10-1 describes
the deployment strategy options.
- If importing an EAR file, configure the deployment options:
- Prompt before overwriting existing objects.
- Automatically generate EJB stubs and skeletons.
- Use interoperable naming, which prefixes EJB reference
and resource reference names with "corbaname:rir#rmi"--see "Interoperable naming".
- Use JAR file naming. If selected, the new package
name will match the EJB-JAR file name. Otherwise the new package
name matches the
display-name
element
in the deployment descriptor.
When you are deploying an EAR or EJB-JAR file containing
a sybase-easerver-config.xml file,
which was previously exported from EAServer, do not use the JAR
File Naming option. When exporting packages to a J2EE archive file,
EAServer optionally creates a sybase-easerver-config.xml file
that includes configuration information based on the package names.
If you deploy a package or an application that contains packages
with the JAR File Naming option, EAServer renames the packages.
When the package names do not match the names in the sybase-easerver-config.xml file,
deployment fails.
- Click Next. The Deploy wizard reads the EAR or JAR file
and creates a new application. Any errors display in the status
window. Review the status information, then click Close.
What is created during import
When you import a Jaguar JAR, the Deploy wizard creates an
application identical to the original.
When you import an EAR, the Deploy wizard creates:
- An application with the same name as the display
name in the EAR file's XML descriptor. If there is no display
name, the new application has the same name as the EAR file.
- For each EJB-JAR file in the EAR, a package with
the same name as the EJB-JAR display name, or the name of the EJB-JAR
file if there is no display name.
- For each bean in an EJB-JAR file, an EJB component
with the same name as the ejb-name element in
the EJB-JAR deployment descriptor.
Home names for imported EJB components When importing from EAR or EJB-JAR files, 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.
- For each WAR file in the EAR, a Web application
with the same name as the display name in the WAR file's
XML descriptor. If there is no display name, the new Web application
has the same name as the WAR file.
- For each servlet defined in a WAR file, a Web application
component with the same name as the servlet-name element
in the Web application deployment descriptor.
If the EAR file did not contain EAServer XML configuration
files, you may need to configure the following settings in the Component
or Web Application Properties dialog boxes before running EJBs,
servlets, or JSPs:
- Role mappings
- Resource references
- EJB references (to components that are not installed
with the EAR file)
- Environment properties
- Resource environment references
Other settings have been configured by the Deploy wizard.
Use the status dialog as a to-do list In the deployment status dialog box, Jaguar Manager displays
warnings for each setting that requires further attention before
you run the application. You can copy and paste this text to a text
editor to use as a to-do list.
Copyright © 2002 Sybase, Inc. All rights reserved.
|
|