Chapter 11: Creating CORBA 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 “Custom class lists for Java and EJB 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 mofifying the server’s CLASSPATH environment variable.
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.
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.
You can 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 on the Java Classes tab in the Component Properties Dialog box. “Custom class lists for Java and EJB components” describes how to configure the custom class list.
Refreshing a component
Copy new versions of the changed class or JAR files to 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 30, “Configuring Custom Java Class Lists.”
In EAServer 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
the component cannot be refreshed. This property must be set on
the Advanced tab in the Component Properties window. See “Component properties: Advanced” for more
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
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 © 2005. Sybase Inc. All rights reserved.|