BEA Logo BEA WebLogic Server Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

Coming Soon

Using the Integration Kit for Visual Age

Introduction
Using the Integration Kit
The Visual Age workspace
Running WebLogic Server
Debugging
Using the EJB tools
Setting classpath within Visual Age
Frequently asked questions

Introduction

Visual Age for Java is an integrated, visual environment that supports the complete cycle of Java program development. With the Integration Kit for Visual Age, you can develop and debug your WebLogic Server applications from within Visual Age. This document describes how to use the Integration Kit for Visual Age with WebLogic Server. To download and install the Integration Kit for Visual Age, go to BEA WebLogic Developer Tools Resources.

Using the Integration Kit

Included below are some important concepts and instructions on performing common tasks.
The Visual Age workspace
Running WebLogic Server
Debugging
Using the EJB tools
Setting classpath within Visual Age

The Visual Age workspace

All activity in Visual Age for Java is organized around a workspace, which contains the Java programs that you are developing. The workspace also contains all the packages, classes, and interfaces that are found in the standard Java class libraries, and other libraries that your classes may need.

The Integration Kit for Visual Age adds the classes required to run WebLogic Server to your workspace. As you develop and debug your applications you will add classes and projects to your workspace. Note that while the server classes are loaded from the Visual Age workspace, the weblogic.system.home property is set to the installation directory of your WebLogic distribution. Therefore, the server will read its properties from the weblogic.properties file in the WebLogic home directory, just as it does when you run it outside of Visual Age.

Running WebLogic Server

To run WebLogic Server, double-click on the WebLogic Server project in the All Projects pane of on the Projects tab and click on the Run button, or right-click on the WebLogic Server and select Run Main in the Run submenu.

Debugging

You can debug server-side and client-side code by following these steps:
  1. Create a Visual Age project.

    To use the Visual Age debugger, any server-side classes must be in a Visual Age project. You can either create the project in Visual Age, or if the code already exists, you can import it into Visual Age. It is acceptable for client-side and server-side code to be in the same project.

  2. If the object you have developed is a server-side object, add the project to the Project Path field of the Classpath for the Server class.

    Expand the WebLogic Server project, then the weblogic.integration.visualage.server package. Right-click on the Server class and select Properties. On the Class Path tab, click on Edit for the Project Path field. Select the check box for your project, and click OK.

  3. Edit weblogic.properties as required.

    When running WebLogic Server from within Visual Age, classes are loaded from the Visual Age workspace, but the weblogic.properties file is read from the WebLogic home directory.

  4. Run the server.

You can set breakpoints in server-side code and then trace the code when it is invoked from a client. You may choose to run the client from within or outside of Visual Age, whichever is more convenient. Note that external client calls may time out if the server is stopped at a breakpoint for too long.

In addition, the Visual Age class loader allows you to modify and continue debugging server-side code without restarting WebLogic Server, as long as you only change the content the object methods. Changes to an object's interface will require restarting the server.

Using the EJB tools

When developing EJBeans, there are a number of steps that must be performed to convert your source code into a Bean that can be deployed by WebLogic Server. The Integration Kit includes tools that help build and manage your EJB projects from within the Visual Age IDE. The EJB tools, which are available from the Selected\Tools\WebLogic Tools menu, are:
  • Generate EJB jar. This tool generates an EJB jar file from the selected EJB package. If it is the first time that you have built the package, you will be prompted for a deployment descriptor text file, a jar manifest file, and output jar file name. There should not be any spaces in the jar file name or in the directory names in the path of the jar file. If you need to change these attributes later, use the Configure EJB package tool. In order to use these tools, the EJB project must include a text deployment descriptor and a jar-file manifest.

  • Configure EJB package. This tool allows you to associate a new deployment descriptor, jar manifest file, and output jar file name with the selected EJB package. There should not be any spaces in the jar file name or in the directory names in the path of the jar file.

  • Configure tools. This tool associates the EJB tools with the root directory of the WebLogic distribution. This is necessary because the EJB tools depend on classes in the WebLogic distribution that have not been imported into the Visual Age workspace. This tool was run as part of the installation process and does not need to be re-run unless you move the location of the WebLogic distribution.

To use these tools, double-click on an EJB package or project. Then select the menus Selected, Tools, WebLogic Tools, then the appropriate tool. To deploy an EJB in the server, you must add the generated jar file to the deploy statement in the weblogic.properties file. See BEA WebLogic Server Enterprise Java Beans for more information on deploying EJBeans.

Note: To use the Generate EJB jar tool, users of the Enterprise Edition of Visual Age for Java will first need to create an open edition of the EJB package. To do this, select the package and choose the menus Selected, Manage, Create Open Edition.

While debugging an EJBean, you may change the content of the Bean methods without rebuilding the jar. Changes to the EJBean's interfaces (remote interface or home interface) or the addition of a new EJB jar file require the use of the Generate EJB jar tool and restarting the server.

Note: While it is possible to debug and modify an EJBean without rebuilding the jar file, you must rebuild the jar before attempting to deploy the EJBean in a server running outside of Visual Age.

Any of the WebLogic EJB examples can be built with these tools by selecting the individual EJB example package in the WebLogic Examples project.

Setting classpath within Visual Age

In Visual Age for Java, you can set classpath at the workspace level and at the class level.

If you specify a workspace level classpath, every class in the workspace will reference these classes when compiling or running. This classpath is also needed to find resource files your classes use. During the installation process for the Integration Kit for Visual Age, you added the WebLogic Server Classes, WebLogic Support Libraries, and WebLogic Java Enterprise Libraries to the workspace level classpath. This was done because most of these classes are required by the examples included with the Integration Kit. To modify this classpath:

  1. Select Options on the Window menu.
  2. In the Options dialog, select Resources.
  3. Click on Edit next to the Workspace classpath field.

I addition, you may also set classpath at the class level. These classes are appended to the workspace level classpath for the given class. To set the classpath for a class:

  1. Right-click on the class and select Properties from the class's pop-up menu.
  2. Click the Classpath tab in the Properties notebook.
  3. Click on Edit next to the Project path field.

Frequently asked questions

Using Type 2 JDBC drivers

Q When I use a Type 2 JDBC driver, such as the Oracle driver shipped with WebLogic, I get strange errors such as "LDA not set", or the Visual Age IDE crashes.

A You need to download and install the "JNI fix for caching method ID's" from the Visual Age Developer Domain, as described in the Before you begin section.

Using Cloudscape database

Q When I use the Cloudscape database in Visual Age, I get a java.lang.VirtualMachineError in FileDescriptor.sync.

A This is a known problem. According to IBM, this problem will be fixed in Visual Age 3.0, but there will not be a fix for Visual Age 2.0. The work around is to use a different database when running WebLogic in Visual Age.

Using EJB dynamic deployment

Q Can I use the new dynamic EJB deployment while debugging server-side code in Visual Age?

A Not currently. Dynamic deployment uses classloaders in ways which are incompatible with the debugger classloader in Visual Age. However, the debugger will reload modified classes at runtime, so you can do much of the work of developing and debugging server applications without restarting the server.

 

Copyright © 2000 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
Last updated 09/20/1999