
Chapter 11 Creating CORBA Java Components
Deploy Java components
This section describes how to deploy a Java component to a
server for the first time for development testing. Deployment to
production servers is typically performed by exporting and importing
EAServer packages, as described in "Deploying components".
Deploying Java components to EAServer
- Determine the Java code base directory from which
EAServer will load your component's classes. To allow refresh
of the component, use the EAServer java/classes subdirectory,
and add necessary classes and JAR files to the Java Classes tab
in the Component Properties dialog box. See "Refreshing Java components" for more information.
For security reasons, it is preferable to deploy Java
components to the java/classes subdirectory
or some other directory that is not accessible to HTTP downloads.
See "Security considerations for deployment" for
more information. Deploying to this directory also allows your component
to be refreshed, and allows you to deploy classes in JAR files without
reconfiguring the server's CLASSPATH environment variable.
- Make sure that the code base is in the server's
CLASSPATH environment variable. If you use a codebase other than $JAGUAR/html/classes or $JAGUAR/java/classes,
you must reconfigure the CLASSPATH variable as described in "Disabling component refresh". You will not be
able to refresh your component if you use another directory besides these
two.
- Under the code base directory, copy the Java component
and skeleton class files. When copying class files, preserve the
package subdirectory structure.
- Copy other class files and JAR files that your component
depends on to the same codebase. For example, you may need to copy
utility classes that are in your component's package.
- Configure the custom class list to allow component refresh,
as described in Chapter 28, "Configuring Custom Java Class Lists"
Security considerations for deployment
Your application may have a potential security hole if Java
component implementation classes are deployed under the EAServer html directory.
An unauthorized user can implement a program that connects to EAServer's HTTP
port and downloads the component's implementation classes.
The user can then decompile the classes and gain access to potentially
sensitive information such as database passwords. To close this
security hole, Sybase recommends one of the following approaches:
- Deploy Java component implementation classes under
the EAServer java/classes subdirectory.
- Code components that retrieve connection caches
to use the getCacheByName API rather than the
APIs that require a database password. This approach removes database
passwords from your Java class file. However, other sensitive information
may still be present in the Java class file.
- Implement your Java components to retrieve potentially
sensitive information from a properties file that is not located
beneath the EAServer HTML directory.
Refreshing Java components
Jaguar Manager allows you to refresh a component's
implementation classes while the server is running. You do not need
to shut down and restart the server. All classes that can be refreshed
must be deployed under the EAServer java/classes subdirectory.
Classes loaded from a different code base directory will not be
reloaded. EAServer only reloads the component's implementation class,
the skeleton class, and any classes specified in the com.sybase.jaguar.component.java.classes property
(configured on the Java Classes tab in the Component Properties
window). Chapter 28, "Configuring Custom Java Class Lists" describes
how to configure the custom class list.
Refreshing a component
- Copy new versions of the changed class or JAR
files to their respective package subdirectories under the EAServer java/classes subdirectory.
If you are adding new classes or JAR files, you may need to add
them to the custom class list as described in Chapter 28, "Configuring Custom Java Class Lists"
- In Jaguar Manager, select the component, or to refresh
all components in a package, select the package.
- Choose File | Refresh from the menu.
If the com.sybase.jaguar.component.refresh property
is set to false
(the default is true
),
the component cannot be refreshed. This property must be set on
the All Properties tab in the Component Properties window. See "Component properties: All
Properties" for more information.
Disabling component refresh
In some cases, you may want to disable refresh for Java components.
You can do so by setting the com.sybase.jaguar.component.refresh
component property
to false.
When refresh is disabled, all Java classes that your component
depends on must be deployed under a Java code base that is specified
in the server's CLASSPATH environment variable. If the
component uses classes in a JAR file, you must add the JAR file
to the server CLASSPATH variable.
If you deploy your component files to the class tree that
starts in the EAServer java/classes or html/classes subdirectory,
they will be in the server CLASSPATH by default. If you deploy to
another location, add this location to the CLASSPATH setting for
the server process.
Copyright © 2002 Sybase, Inc. All rights reserved.
|
|