Pramati Technologies

Working with Oracle 9iAS

Studio provides tight integration with Oracle 9i Application Server (version 1.0.2.2.1, and 9.0.2.1.0). Studio automatically creates the required deployment descriptors when the application is deployed, and keeps the application in a "ready-to-deploy" state. This chapter discusses how to develop EJB 1.1 applications using Studio and deploy them on Oracle.

Configuring Oracle Deployer

To develop applications in Studio and test-deploy them on Oracle 9iAS server, the Oracle Deployer needs to be configured in Studio. Click on Tools > Configure from the main menu. In the Tools Configure dialog that comes up, check against the option - Oracle Deployer.

After closing the Tools Configure dialog, multiple instances of the Oracle server can be created in Studio, which is typically one development server on the development machine or a single central production server on the remote machine.

Applications developed in Studio can be deployed on both local and remote Oracle servers. In case of remote deployment, the server must be installed on the development machine and the remote machine.

Note: Each configured Server instance has its own tab in the Output Panel.

Creating Oracle Server Instances

To create an instance for Oracle Server, click on Tools > Server Configuration from the main menu. In the Server Configuration dialog that comes up, click on the New button to create a new instance of the server. In the Add New Server dialog that pops up, enter the following information:

Server Name Enter the name of the server instance that is to be created in the dialog

Server Type Select the type of the server from the list in the combo box as Oracle 9iAS.

Pressing OK creates an instance of the server and displays the Server Config panel, where WebSphere properties are to be configured:

Server Name The Server name is automatically selected as the name entered in the Add New Server dialog. To select another server instance that is to be configured, choose from the list in the combo box

Server Type The Server type is displayed as the type selected in the Add New Server dialog

Oracle9iAS Version Select one of the versions from the two available in the combo box. Studio supports the two versions, 1.0.2.2.1 and 9.0.2.1.0

IP Address Enter the IP address on which Oracle Server is installed and where the application will be deployed. Example, localhost

Naming Port Enter the RMI Port number on which the server listens for RMI requests. The port number should be the same as in rmi.xml configured by the user. The RMI Port number is by default 23791.

HTTP Port Enter the port number, which Oracle Server uses to listen for http requests. This port number should have the same value as was configured by the user in the file default-web-site.xml. This is by default, 8888.

Install Dir This is the directory on the local machine, where Oracle 9iAS Server has been installed. Filling in the wrong installation directory prompts the user for the valid installation directory.

Example

c:\Oracle\oracle9ias

This directory is the parent directory of the subdirectory /j2ee/home created when Oracle server is installed.

User Name Enter the user name required to login to the server on which the application is to be deployed. For example: admin

Password Enter the system password for Oracle Server in this field. The password entered here should be the password that was supplied when Oracle Server was installed.

After filling in all the required information, use the OK button to add the instance of the Oracle Server. To delete a server instance, select the required server from the field, Server Name and use the Delete button.

Starting & Stopping Server

After creating the Oracle server instance in Studio close the Server Configuration dialog, and select the instance from the Server Box in the Status bar. Selecting the Oracle server here makes it the current server, and all server specific operations for the active Desk is performed on the current server.

The Oracle server can be started/stopped in a similar way as any other server in Studio. Use Tools > Start Server to start the Server. To stop a server, use Tools > Stop Server from the main menu. The Server can also be started/stopped using the signal box.

All resources defined in the Desk are bound to the current server when the server is started. Adding a resource on the Desk with the same JNDI name as that of a resource on Oracle server, overwrites the resource on the server.

Adding a resource in Studio with the JNDI name with the same JNDI name as a resource defined on Oracle server, overwrites the resource on the server.

A remote server cannot be started from within Studio.

Deploying on Oracle

Applications can be deployed on Oracle as normal archived JARs, WARs, and ears, or directly as Modules.

Deploying the Desk as an archive

Right Clicking on the Desk > Deploy as .ear always deploys the application as an enterprise archive on the current Oracle server.

The enterprise archive is created by packaging the EJB modules as JARs, the Web Modules as WARs, and then adding these into the EAR with the name - Desk_DeskName.ear, where DeskName is the name of the Desk. The ear is stored under the directory, <install_dir>\oracleEars and deployed on Oracle server. The ear contains all the Oracle specific xml files, which can be used to deploy on any Oracle server outside Studio.

Deploying the Desk using the option Deploy as ear, and then deploying it using the option Deploy, always deploys the Desk as two different applications.

Deploying the modules

Right clicking on the module > Deploy always deploys the module on the current Oracle server. Deploying a module

Example

If a module inside a Desk named "mydesk" is chosen, and it comprises one EJB Module called myEJBmodule and one Web Module called myWEBmodule, the directory structure is created as

Deploying a module on a right click allows them to be deployed independently on Oracle server when changes are made in the module. All the server specific xml files are also auto-generated and stored in the correct position. The application need not be re-deployed each time for the changes made in the module to be picked up.

Exporting into archives

Developing applications in Studio creates archives and modules with Pramati xml files. To create archives with Oracle xmls, follow the given steps:

Debugging on Oracle

Pramati Studio supports debugging applications on local as well as remote server. JSP Pages can be debugged only on a local server. To start the debugger, use Debug > Start from the main menu.

If the server is on the local machine, then check the option, Application for J2EE. This starts the server in the debug mode. The application can now be deployed. The Debugger panel appears only after the breakpoints have been inserted.

If the server is on a remote machine

Oracle Usage Restrictions

Example

Oracle Server does not support remote and local interfaces (since it does not support all J2EE 1.3 specifications)


Pramati Technologies  © Copyright   TOCPREVNEXTINDEX