Chapter 12 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 Jaguar packages, as described in "Deploy components".

Steps To deploy Java components on a Jaguar server:

  1. Determine the Java code base directory from which Jaguar will load your component's classes. To allow refresh of the component, use the Jaguar java/classes subdirectory, and set the com.sybase.jaguar.component.java.classes property. See "Refreshing Java components" for more information.

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

  2. Make sure that the code base is in the Jaguar 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 "Verify server CLASSPATH". You will not be able to refresh your component if you use another directory besides these two.

  3. Under the code base directory, copy the Java component and skeleton class files. When copying class files, preserve the package subdirectory structure.

  4. Copy other class files that your component depends on and that are not already deployed under a code base that is in the server's CLASSPATH variable. For example, you may need to copy stubs for user defined types and utility classes that are in your component's package.

  5. Make sure that Jaguar server machine's CLASSPATH environment variable includes the directory at the root of the component's Java package.


Verify server CLASSPATH

All Java classes that your component depends on must be deployed under a Java code base that is specified in the Jaguar server's CLASSPATH environment variable.

If you deploy your component files to the class tree that starts in the Jaguar 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 as follows:

Security considerations for deployment

Your application may have a potential security hole if Java component implementation classes are deployed under the Jaguar html directory. An unauthorized user can implement a program that connects to Jaguar'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:

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 Jaguar java/classes subdirectory. Classes loaded from a different code base directory will not be reloaded. Jaguar only reloads the component's implementation class, the skeleton class, and any classes specified in the com.sybase.jaguar.component.java.classes property. This property must be set on the All Properties window. "All Properties tab" describes how to set properties on this tab. "com.sybase.jaguar.component.java.classes" describes the syntax of this property.

Steps You can refresh a component as follows:

  1. Copy new versions of the changed class files to their respective package subdirectories under the Jaguar java/classes subdirectory.

  2. In Jaguar Manager, select the component, or to refresh all components in a package, select the package.

  3. 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 "All Properties tab" for more information.

 


Copyright © 2000 Sybase, Inc. All rights reserved.