Sun ONE logo     Previous      Contents      Index      Next     
Sun ONE Application Server 7, Standard Edition Sun[tm] ONE Studio 4, Enterprise Edition for Java[tm] with Application Server 7 Tutorial



Setting Up Your Development Environment

Before configuring your development environment, take a few moments to learn about how the Sun ONE Studio 4, Enterprise Edition for Java and Application Server 7 products are integrated.

Sun ONE Studio 4 and Application Server Integration

The application server software that extends the IDE's functionality is generally referred to as the application server's "plugin" for the IDE. The plugin consists of a series of JAR and configuration files that are installed in either the IDE's installation directory or a user's IDE directory.

Installing the IDE Plugin

There are three means by which a user can install the application server plugin in a Studio 4 installation:

  1. Plugin is installed as part of a combined application server and IDE installation.
  2. Plugin is installed as a component using the application server's installation program.
  3. Plugin is downloaded and installed as a NetBeans[tm] module from the Sun ONE Studio Update Center.

Although editing of Sun ONE deployment descriptors and development of CMP EJBs can be accomplished by using only the plugin and the IDE, the most common scenario is to also configure the IDE connect to an application server deployment environment for the purpose of deploying and testing applications.

Connecting the IDE to Application Server Deployments

The plugin relies on a small number of administrative client JAR files that enable the plugin to communicate with the administrative server of an application server deployment. Once the plugin is installed in either the IDE or a user's IDE directory and the administrative client libraries have been made available on the same machine, a property must be set to inform the plugin about the location of the administrative client libraries.

Once the administrative client libraries are installed and the IDE is configured properly, the developer is able to register any number of either local or remote application server deployment environments in the IDE. Any one of these registered application server deployments can be designated as the default server in the IDE.

When you install the evaluation distribution of Sun ONE Application Server 7 that also includes Sun ONE Studio 4, Enterprise Edition for Java, the plugin and dependent administrative client files are installed automatically. In the case of a combined installation, the plugin is automatically configured to point to the application server's installation location so that the plugin can access the administrative client libraries.

Setting Up Your Development Environment

Your first step in working with Sun ONE Studio 4 and Application Server 7 is to set up the two environments to work together. Based on the products that you've installed on your system(s), use the following table to determine the steps required to set up your development environment.



Note

Application Server Must be Installed: The following starting points assume that you've already installed the application server. If you have not already installed the application server, download Sun ONE Application Server 7 and install it according to the instructions contained in the Getting Started with Sun ONE Application Server 7 guide on the Sun Microsystems documentation web site. If you have not already installed Sun ONE Studio 4, Enterprise Edition for Java, download the application server distribution containing the IDE. Installation of the combined Sun ONE Application Server 7 and Sun ONE Studio 4, Enterprise Edition for Java distribution results in a minimal number of post installation configuration steps.





Caution

Solaris 9 Users: If the Sun ONE Application Server 7 product was installed as part of a Solaris 9 installation, then you must follow the Getting Started with Sun ONE Application Server 7 guide on the Sun Microsystems documentation web site in order to set up your own application server and PointBase database environment prior to following this tutorial. If you do not follow the set up instructions in the Getting Started guide, you will not be able to complete this tutorial. If you find the directory /usr/appserver/ in your Solaris 9 installation, then the application server was installed as part of the Solaris 9 installation. If this is the case, then you need to first follow the set up instructions for the application server and PointBase database as described in the Getting Started guide.



  

Starting Point

 

Description

 

Steps

 

Application Server and Studio 4 Installed Together

 

Evaluation distribution of Sun ONE Application Server 7 including Studio 4 has already been installed on your system.

 

Register Target Application Server

 

Studio 4 Not Yet Installed

or

Studio 4 Installed Separately from the Application Server

 

Products installed separately.

 

1. Install Sun ONE Studio 4, Enterprise Edition for Java (if not already installed)

2. Install IDE Plugin (Sun ONE Application Server 7 Plugin for Studio 4)

3. Register Target Application Server

 

Studio 4 and Application Server Installed on Separate Machines

 

Remote development server scenario.

 

1. Install IDE Plugin (Application Server 7 Plugin for Studio 4 Enterprise Edition) on Development Workstation.

2. Register Target Application Server

 

Install Sun ONE Studio 4, Enterprise Edition for Java

If you have not already installed the IDE, download Sun ONE Studio 4, Enterprise Edition for Java and follow the installation instructions in the Getting Started Guide for Sun ONE Studio 4, Enterprise Edition for Java. The Getting Started Guide for Sun ONE Studio 4, Enterprise Edition for Java can be accessed through either the Documentation section of the Sun ONE Studio 4 product page or docs.sun.com.

When installing the IDE, it is recommended that you use either Java[tm] 2 SDK (J2SDK), Standard Edition 1.4.0_02 or greater so as to match the J2SDK requirements of Sun ONE Application Server 7. Refer to the Sun ONE Studio 4, Enterprise Edition for Java Getting Started Guide and Sun ONE Application Server 7 Installation Guide for detailed J2SDK compatibility information.

Once you've installed the IDE according to the instructions in the IDE's Getting Started Guide, continue following instructions in this section to install the Sun ONE Application Server 7 plugin and to register a Sun ONE Application Server 7 runtime environment as the default application server in the IDE.

Install IDE Plugin

If you installed the combined Sun ONE Application Server 7 and Sun ONE Studio 4, Enterprise Edition for Java evaluation distribution, then you do not need to install the IDE plugin. In this case, proceed to the section Register Target Application Serverto complete the IDE set up process.

If you did not install the combined application server and IDE distribution, follow these instructions to install the application server's plugin for the IDE. The plugin installation instructions vary depending on whether the IDE is installed on the same machine as the application server or the IDE and application server are installed on different machines.

Application Server and IDE Installed on Same Machine

If the application server is installed on the same machine as the IDE but you did not install the combined application server and IDE products, you must install the application server's plugin for the IDE. There are two ways in which you can accomplish the plugin installation:

Download Plugin from the Sun ONE Studio Update Center

The application server's plugin for the IDE is available as a NetBeans Module file (.nbm file) through the Sun ONE Studio Update Center. You can use the IDE's Update Center Wizard to connect to the update center and install the Sun ONE Application Server 7 IDE plugin module.



Note

Installing Manually Downloaded Plugin Module: If you obtained the .nbm file for the IDE plugin through some means other than the Sun ONE Studio Update Center, you can use the IDE's Update Center Wizard to install the .nbm file directly. On the first screen of the Update Center Wizard select the Install Manually Downloaded Modules option to install the plugin module directly.



  1. In the IDE, select Tools -> Update Center... to access the Sun ONE Studio Update Center.
  2. The Select Modules to Install window is displayed.

  3. Under Available Updates and New Modules, select the Sun ONE Application Server 7 plugin module and move it to the Include in Install portion of the window. Click Finish to begin installation of the plugin module.

To complete the installation of the plugin module, the IDE must be restarted.



Note

Location of Installed Modules: When you install a module via the Update Center facility of the IDE, the files that make up the module are installed in your user's IDE directory rather than in the installation directory of the IDE. This approach ensures that modules installed by users through the update center do not conflict with one another.



Proceed to the section Register Target Application Server to complete the IDE set up process.

Install the Plugin Using the Sun ONE Application Server 7 Installer

If you have access to the non-evaluation distribution of Sun ONE Application Server 7, you can use the application server's installation program to install the application server's plugin.

  1. Start the application server's installation program.
  2. In the Select Installation Directory screen, ensure that the location of your existing application server installation directory is specified.
  3. In the components selection screen, select the component named Support for Sun ONE Studio 4, Enterprise Edition for Java.
  4. When prompted for the installation location of the IDE, enter the appropriate location and continue with the installation process.

If the IDE is running, then restart it and proceed to the section Register Target Application Server to complete the IDE set up process.

Application Server Installed on Remote Development Server

If the application server is not installed on the same machine as the IDE and you plan to use the IDE to work with an application server installed on a remote server, then you need to install both the application server's plugin for the IDE and the application server's administrative client support on the development workstation.

If the application server is already installed on the same machine as the IDE and you'd like to use the IDE to work against a remote application server, the application server's administrative client support is already installed. In this case, proceed to the section Register Target Application Server to complete the IDE set up process.

To install the application server's plugin for the IDE and the administrative client support, you can use the non-evaluation distribution of the Sun ONE Application Server 7 product. In this distribution the installation program enables you to select a component named Support for Sun ONE Studio 4, Enterprise Edition for Java. Selection of this component results in the installation of both the application server's plugin for the IDE and the administrative client support.

Alternatively, if you have access to only the evaluation distribution of the application server, you can install the complete application server on the development workstation and follow the steps in Application Server and IDE Installed on Same Machine to install the application server's plugin for the IDE.

In any case, once you've installed the plugin and the administrative client support, proceed to the next section to complete the IDE set up process.

Register Target Application Server

Once you've installed Sun ONE Studio 4, Enterprise Edition for Java and the application server's plugin, you are ready to register a target Sun ONE Application Server 7 runtime with the IDE.

  1. Start the Application Server
  2. Start the IDE
  3. Set Sun ONE Application Server as the Default Server

Start the Application Server

If the application server is not already started on either your local workstation or on a development server, start the application server at this time.

The application server must be started in order for you to register an application server with the IDE.

Start the Application Server on Windows Platforms

To start the application server from the Windows desktop, select:

Start -> Programs -> Sun Microsystems -> Sun ONE Application Server 7 -> Start Application Server

After selecting Start Application Server, a command window is displayed to show the status of the startup process.

A second command window also appears on your desktop. This command window is a read only representation of the server event log file content. The second command window remains on your desktop as long as the associated application server instance is running. As the initially configured server starts, event messages appear in the second command window. After a few seconds, a message confirming that the server instance has started successfully appears in the command window.

Start the Application Server on UNIX Platforms

On UNIX platforms, execute the following command:

$ <appserver_install_dir>/bin/asadmin start-domain --domain domain1

Execution of this command starts the initially configured domain, named "domain1", on your system.

Start the IDE

Start the IDE by running the program executable, as described in this section. For more detailed information about starting the IDE, see the Getting Started Guide for the Sun ONE Studio 4, Enterprise Edition on the Sun Microsystems web site.

The first time you use the IDE, several dialog windows appear that allow you to do the following:

  • Set the user directory to store user and IDE configuration information.
  • Import settings from a previous installation of the IDE.
  • Configure a proxy server if you are behind a firewall.
  • Set your preferred web browser.
  • Register the product. After registering, you will be eligible for any product updates that are released.



Note

Registering the Product: It is highly recommended that you register your product installation so that you can access the NetBeans and Sun ONE Studio update centers. To register for updates, you need the serial number of your IDE installation. The serial number is displayed in the Registration Wizard. This wizard can be displayed by accessing Help -> Registration Wizard in the IDE.

The update centers can be accessed via the Tools -> Update Center item in the IDE.



Start the IDE on Windows Platforms

There are three methods of starting the IDE:

  1. From the Windows desktop, select:
  2. Start -> Programs -> Sun ONE Studio 4u1 EEfJ -> Sun ONE Studio

  3. Double-click the Sun ONE Studio 4u1 EEfJ icon on your desktop.
  4. Run the runide.exe executable from the command line. For example:
  5. c:\> <ide_install_dir>\bin

Start the IDE on UNIX Platforms

A runide.sh script is located in the ide_install_dir/bin/ directory. Start the IDE by executing following command in a terminal window:

<ide_install_dir>/bin/runide.sh

Set Sun ONE Application Server as the Default Server

Since the exercises in the guide depend on the Sun ONE Application Server, you need to make sure that an available Sun ONE Application Server is registered and is set as the default server in the IDE.

Once you set an application server as a default server, all deployment, execution and debugging operations selected from within the IDE automatically targets the default server.

Ensure Plugin is Configured with Application Server Installation Directory

In order for the IDE and plugin to interact with a Sun ONE Application Server 7 runtime, the plugin must be configured to point to the installation location of either the fully installed application server or the application server's administrative client libraries. If you installed the evaluation distribution of Sun ONE Application Server 7 that also included the IDE, the plugin has already been configured with the appropriate application server installation directory.

  1. In the IDE, bring up the Explorer window and Runtime tab at the bottom of this window. If you do not see the Explorer window, simply select View->Explorer from the main IDE window.
  2. Expand the Server Registry, Installed Servers, and Sun ONE Application Server 7 nodes.



Caution

Sun ONE Application Server 7 Does Not Exist: If you do not see Sun ONE Application Server 7 node in the Installed Servers area, then it is likely that the plugin module for the application server has not yet been installed. See the Install IDE Plugin section for instructions on installing the application server plugin.



  1. Right-click the Sun ONE Application Server 7 node and select Properties.
  2. The properties editor is displayed.

  3. Ensure that the Sun ONE Application Server Home property is configured with the location of either the application server or application server's administrative client component.
  4. For example, on Windows systems, this property value may appears as follows:

    c:\Sun\AppServer7

    On Solaris[tm] systems, examples of the property setting include:

    /usr/appserver

    /opt/SUNWappserver7

    <home_dir>/appserver7

Register a Sun ONE Application Server

Now that you've ensured that the plugin is configured properly, your next step is to register a specific application server runtime environment with the IDE.



Caution

Application Server Must Be Running Prior to Registration: You must start the application server prior to attempting to register it in the IDE. Specifically, the administrative server must be running prior to registration.



To register an application server:

  1. Under Installed Servers section, expand the Sun ONE Application Server 7 node.
  2. If you see a localhost:port node under the Sun ONE Application Server 7 node, an application server instance is already registered. If the named server is the one with which you plan to work, you can proceed to the Verify that the Application Server Instance is Running section.

  3. If you either do not see a registered application server or the registered server is the not the server of interest, right-click the Sun ONE Application Server 7 node and choose Add Admin Server.
  4. The Add Admin Server dialog box appears.

  5. Type localhost in the Admin Server Host field.



Note

Accessing a Remote Application Server: You can also register an application server running on a remote machine. To register the application server on an another machine, type the remote machine's hostname or IP address instead of localhost in the Admin Server Host field.



  1. Type your server's administrative server port number in the Admin Server Port field.



Caution

Forgot the Admin Server Port Number? If you do not remember the HTTP server port number of the administrative server, you can inspect the administrative server's configuration file to determine the HTTP server port number.

1. Navigate to the following directory:

<appserver_domain_config_dir>/domain1/admin-server/conf/

2. Open the server.xml file in your favorite editor. Look for the element:

<http-listener id="http-listener-1" address="0.0.0.0" port="4848"...

In this case, port 4848 is the HTTP port number in use.



  1. Type the administrative user name in the User Name field.
  2. Type the administrative password you specified during installation in the User Password field.



Caution

Forgot the Username or Password? If you do not remember the administrative user name that was supplied during installation, try the user name "admin". This is the default user name specified in the server configuration dialog during installation. If you still cannot determine the user name, look in the following file:

<appserver_domain_config_dir>/domain1/admin-server/config/admpw

This file contains the administrator's user name followed by the encrypted form of the administrative user's password.

If you do not remember the administrator's password, then you can delete the administrative domain using the delete-domain subcommand of asadmin and create a new domain with a new administrative password.



  1. Click OK.
  2. You should now be able to see the application server listed as an installed server.


Figure showing Sun ONE Application Server 7 showing up beneath the Intalled Servers icon in Runtime window

  1. Expand the localhost:port administration server node, you can see a node named server1(localhost:4848) that corresponds to the application server instance that was created during installation of the application server. You will be using this instance throughout this tutorial.
  2. Right-click the server1(localhost:4848) node and select Set As Default.
  3. Verify that the default server has been set correctly by expanding the Default Servers node under the Server Registry area.
  4. You should see the server1(localhost:4848) item as the default server instance.


    Figure showing J2EE Applications server and Web Tier Applications server under Default Servers icon in Runtime window

Verify that the Application Server Instance is Running

In this section, you will examine whether or not the application server instance is running and to start it if it is not running.

  1. Right-click the server1(localhost:port) instance node and select Status.
  2. The Server Status dialog box appears. If the Start Server Instance button is disabled, the application server instance is already running and you can skip the next step, number 2.

  3. Click the Start Server Instance button.
  4. After several seconds, the application server instance starts, and the Server Status dialog box indicates that the instance is started.

  5. Click OK to close the Server Status dialog box.
  6. Now that the application server is started and the IDE is configured properly, you are ready to proceed to Developing Session Beans and Web Applications.


Previous      Contents      Index      Next     
Copyright 2002 Sun Microsystems, Inc. All rights reserved.