Configuring the component properties  Chapter 8: Creating Enterprise JavaBeans Clients

Chapter 7: Creating Enterprise JavaBeans Components

Deploying the component classes

If you are creating components from scratch in EAServer Manager, you must follow the steps in this section to deploy the component class and other classes that it depends on. If you deploy from JBuilder with the EAServer plugin, the plugin performs these steps for you. If you are using another EJB development tool that can export EJB JAR files, import the EJB JAR file as described in Chapter 9, “Importing and Exporting Application Components,” in the EAServer System Administration Guide. If you import an EJB-JAR file that calls EAServer components that are not implemented in the same JAR file, you must list the stub classes for the called components in the custom class list as described below.

EAServer supports hot refresh of components by using a Java class loader. This feature speeds the development process by allowing you to deploy new class versions without restarting the server. Repeat the steps below to deploy new versions of your implementation.

In a production environment, you may wish to disable refresh to improve performance. See “Disabling refresh” for details.

StepsDeploying EJB component classes

  1. Deploy the component class files, stub and skeleton files, and other classes required by the implementation to EAServer. For example, you may need to copy stubs for user defined types and utility classes that are in your component’s package.

    If deploying class files, place each class in their respective java/classes package subdirectories. If deploying a JAR file, place it in the java/classes subdirectory.

    NoteThe preferred code base is java/classes 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. 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. If you deploy to another location, make sure it is listed in the server’s CLASSPATH environment variable.

  2. Use EAServer Manager to configure the component’s custom class list, specifying the classes that must be loaded when your component is loaded or reloaded, as described in “Custom class lists for Java and EJB components”.

  3. Use EAServer Manager to refresh the component by highlighting its icon and choosing File | Refresh. You can also refresh the component by refreshing the package, application, or server where it is installed.

NoteTroubleshooting ClassCastException errors When calling javax.naming.InitialContext.lookup, if you see NamingContext exceptions with root-cause exception ClassCastException, check for the following errors:

For more information, see “Troubleshooting class loader configuration issues”.

StepsDisabling refresh

In a production server, you may wish to disable refresh for Java components to decrease memory use and increase performance. When refresh is enabled, duplicate copies of common Java classes can be loaded for components. When refresh is disabled, you must restart the server in order for it to load a new version of your component class. You can also reduce duplicate in-memory classes by configuring the custom class list at the package, server, or application level as described in “Custom class lists for packages, applications, or servers”.

If your component calls another Java or EJB component, both must have refresh enabled or both must have refresh disabled.

To disable refresh:

  1. Make sure the code bases for all classes used by your component are in the server’s CLASSPATH environment variable. JAR files referenced in the custom class list must be added to the server CLASSPATH setting, or expanded into the java/classes EAServer subdirectory.

  2. Display the Component Properties dialog box, and click on the Advanced tab.

  3. Set the com.sybase.jaguar.component.refresh to false (the default is true).

  4. Restart the server for the changes to take effect.





Copyright © 2005. Sybase Inc. All rights reserved. Chapter 8: Creating Enterprise JavaBeans Clients