C H A P T E R  9

Using Sun Java System Application Server Instances in the IDE

Once you have successfully installed the Java Studio Enterprise Tools Components, you can verify the configuration of Sun Java System Application Server Standard Edition 7 2004Q2 (Application Server) as your default application server. The Java Studio Enterprise IDE includes the Sun Java System Application Server plug-in. This chapter describes common procedures enabled by the plug-in and describes the scenarios for Application Server instance creation and for IDE usage. The chapter also includes some background information on administrative domains and some other common application servers tasks.

The application server documentation describes administering and using Application Server in more detail. You can find the Sun Java System Application Server documentation at http://docs.sun.com/db/coll/ApplicationServer7_04q2.

This chapter covers the following topics:


Understanding Application Server Integration and Instances

The Sun Java System Application Server Plug-In enables tight integration between the IDE and Application Server. This section describes the application server domains and instances created during various installation scenarios and describes the new Application Server automatic start functionality enabled by the plug-in. The following topics are covered:

Application Server Instances (Microsoft Windows)

Sun Java System Identity Server and Sun Java System Portal Server can be installed from the Optional Servers portion of Sun Java Studio Enterprise 7. These two products are essentially web applications that run in a web container. The web container can be either Application Server or Web Server. The default web container is Application Server. The resulting server instances are described in TABLE 9-1.


TABLE 9-1 Application Server Instances Created During Installation (Microsoft Windows)

Scenario

Application Server Installed

Access Manager Installed

Portal Server Installed

Web Server Selected as

Alternate Web Container

Application Server Domains and Instances Created (see Chapter 10 for Web Server details)

Owner of Domain

1

Yes

No

No

N/A

domain1:admin-server

domain1:server1

administrator

2

Yes

Yes

Yes

No

domain1:server1

domain1:admin-server

 

jstudio-domain:admin-server

jstudio-domain:jstudio-server [web container for Access Manager and Portal Server]

administrator

 

administrator

3

Yes

Yes

Yes

Yes

domain1:admin-server

domain1:server1

administrator


Application Server Instances (Solaris OS)

When you install the Java Studio Enterprise IDE and Application Server, the installer creates one or more preconfigured server instances depending on choices that you make during installation. The following table, TABLE 9-2, describes the possible scenarios and the instances that are created.


TABLE 9-2 Application Server Instances Created During Installation (Solaris OS)

Scenario

Application Server Installed

Access Manager Installed

Portal Server Installed

Web Server Selected as Web Container

Application Server Domains and Instances Created

Owner of IDomain

Non-root usage enabled during install

1

Yes

No

No

N/A

domain1:admin-server

domain1:server1

root

root

No

1a

Yes

No

No

N/A

domain1:admin-server

domain1:server1

non-root user specified during install

Yes

2

Yes

Yes

Yes

No

domain1:admin-server

domain1:server1

 

 

 

jstudio-domain:admin-server

jstudio-domain:jstudio-server [web container for Access Manager and Portal Server]

 

root

root

 

 

root

root

No

2a

Yes

Yes

Yes

No

domain1:admin-server

domain1:server1

 

 

 

 

jstudio-domain:admin-server

jstudio-domain:jstudio-server [web container for Access Manager and Portal Server]

non-root user specified during install

 

root

Yes

3

Yes

Yes

Yes

Yes

domain1:admin-server

domain1:server1

root

root

No

3a

Yes

Yes

Yes

Yes

domain1:admin-server

domain1:server1

 

non-root user specified during install

Yes


Application Server and IDE Integration

Only domain1 instances are visible in the IDE Server Registry. The jstudio-domain (if created), which is used as the web container for Access Manager and Portal Server, must be started and stopped from outside the IDE. See Chapter 13 (Microsoft Windows) or Chapter 14 (Solaris OS) for details on starting and stopping Application Server from outside the IDE.

You do not have to start your IDE's preconfigured Application Server explicitly. This is done automatically at the time the server is accessed. The automatic start is triggered when the application server instance is set as the default J2EE server under the Server Registry "Default Servers" node in the Runtime window. The first time that you access the IDE's Server Registry, the plug-in automatically starts the domain1 admin server and sets the default J2EE server to be the preconfigured application server instance, server1.

The following tasks trigger the automatic starting of Application Server:



Note - To use the Administrative Console, you need the Administrator Password specified during installation.




Using the Default Administrative Domain

This installation of the Java Studio Enterprise IDE and Sun Java System Application Server creates a preconfigured default administrative domain. This domain is added to the IDE's Server Registry. By server design, this administrative domain and its associated administrative server belong to the superuser or administrator performing the installation.

Solaris OS. You can specify that the default domain and server instance belong to a non-root (standard) user account. The option to specify a non-root user account must be selected during installation. See Product Usage by Non-root User. This option is only supported during installation on Solaris OS machines.

If the users of the IDE normally have superuser or administrator privileges, they can start the server using the installed default settings. For example, Microsoft Windows development environments where the developers do their daily work with user logins that have administrative privileges can use the default administrative domain and server as described in To Confirm the Default Administrative Server.

Additional procedures (not described in this book) for using the default administrative domain when the standard IDE user does not have superuser or administrative privileges are:



caution icon

Caution - Changing permissions on the domain directories can create security problems if not handled properly. See the Application Server documentation for more information, refer to TABLE 9-3.




procedure icon  To Confirm the Default Administrative Server

1. Click the IDE's Runtime window.

The Runtime window displays the Server Registry node. The Server Registry node contains subnodes for all of the installed web servers and application servers. There is also a node showing which servers are the default servers.

2. Expand the Server Registry node.

The IDE starts the default admin server and configures Sun Java System Application Server as the IDE's default application server. This process can take a minute or so to complete.

3. Expand the Default Servers node.

Confirm that your server1 instance is set to be the default server for J2EE Applications.

4. (Optional) Expand the Installed Servers node and expand the Sun Java System Application Server 7 node.

IDE's Runtime window showing localhost:4848 (new admin server instance) under Sun Java System Application Server 7 node.

In this screen shot, the node localhost:4848 is your Admin Server instance.

5. (Optional) Expand the localhost:4848 node to see the application server instance server1.

 [ D ]


Understanding Administrative Domains

This section is included from the Sun Java System Application Server 7 documentation to provide background on administrative domains. Sun Java System Application Server introduced a feature named administrative domains that enables you to define multiple, completely separate application server runtime configurations that reuse the same installation image. Each administrative domain is represented by an administrative server which in turn controls one or more application server instances. The configuration of an administrative domain can reside anywhere on the machine.

Although it is likely that developers using their own workstations use a single administrative domain for day-to-day development, both shared development servers and operational environments can greatly benefit from using multiple administrative domains. On shared development servers, creation of an administrative domain for each developer provides a compartmentalized area or "sandbox" for each developer on a shared server machine. In operational environments, administrative domains enable system administrators to define separate secure runtime configurations without requiring multiple installations of the product.

Depending on the engineering practices in your development environment, you have several options for creating or configuring administrative server domains that can be used by individual developers.

TABLE 9-3 describes procedures to help you complete the configuration of Application Server when the preconfigured instances do not meet your development needs..


TABLE 9-3 Application Server Procedures

Description

Procedure Reference

Permitted User

Create an administrative domain for another user to use with the IDE.

See To Create a Domain for Another User

Superuser or administrator only

Add the user domain to the IDE Server Registry.

See To Add the User's Domain to the IDE

All IDE users

Create a user group with permission to manipulate the default administrative domain and server.

See Sun Java System Application Server 7 2004Q2 Administration Guide

Superuser or administrator only

Change permissions on the domain directories to allow standard users to manipulate the default administrative domain and server.

Standard Solaris OS Administration tasks. Consult your System Administrator

Superuser or administrator only


Creating Administrative Domains for Each User

In Solaris development environments, users do not usually run the IDE as a user with superuser privileges. If you are planning to use the bundled Sun Java System Application Server, it is necessary to provide IDE users with access to an administrative domain that they can start and stop. This enables them to create and manipulate application server instances within that domain as required by their development work.

There are multiple ways to provide the end user with access to an admin server domain. The two-step process described here creates a separate domain for the standard IDE user. Once this is done, the user has the maximum flexibility for controlling the use of their admin domain and minimal intervention is required by the system administrator.

This two-step process consists of the following two procedures:

In this process, the superuser completes the first step to create a separate Application Server administrative domain for each standard (non-root) end user. The standard user completes the second step to configure the new domain within the IDE by adding, also referred to as "registering", the administrative domain to the IDE's Server Registry. This enables the standard user to control the administrative server for this domain and to manipulate instances of the application server as needed for development.


procedure icon  To Create a Domain for Another User

The superuser performs this procedure to create a domain for a standard user account. This procedure is performed from the command line outside the IDE. To use this procedure on a Microsoft Windows system, modify the commands and directories as needed. For more information about the asadmin utility, see the Sun Java System Application Server 7 2004Q2 Administration Guide at http://docs.sun.com/source/817-3652-10.

1. Become a superuser or administrator.

2. Change to the directory where the asadmin utility executable is located.

For example, type:


# cd /opt/java-studio-install-dir/AppServer7/bin

This example shows the default installation directory for a Solaris installation. If you specified a different installation directory when you installed this product, replace /opt/java-studio-install-dir with the path name to your installation directory.

3. From the command line, use the asadmin utility to create the domain with the create-domain command.


# ./asadmin create-domain --sysuser standarduser --adminport portnumber --adminuser useradmin --adminpassword userpassword userdomain

The options and associated arguments for this command are described in the following table. The domain name is specified without an associated option.


Option

Argument

Description

--sysuser

standarduser

standarduser is the existing standard user's login id for your system.

--adminport

portnumber

portnumber is an available port number for this admin domain instance.

--adminuser

useradmin

useradmin is the user name associated with this admin domain.

--adminpassword

userpassword

userpassword is the user password associated with the user name for this admin domain.

n/a

userdomain

userdomain is the standard user's domain name and must be unique.

--path

domain_path

Path to the directory where the domain should be created. If not specified, the domain is created in the default domain directory. See the Sun ONE Application Server 7 Getting Started Guide for more information.


The following message displays.


Created Domain userdomain successfully.

4. Exit from superuser privileges.

5. Provide your standard user with the values that you used in Step 3 for the port number, admin user name, admin user password, and the domain name.

The standard user uses these values to complete the configuration of the application server from within the IDE. These values are used in Step 3 in the section, To Add the User's Domain to the IDE.


procedure icon  To Add the User's Domain to the IDE

This procedure is done with the same login and permissions used for running the IDE for normal day-to-day development activities.



Note - If you opted to enable usage by a non-root user during installation (Solaris OS only), do not use this procedure. The default admin domain and server instance created by the installer are already owned and configured for use by the non-root user that you specified during installation.



1. Start the IDE.

2. In the IDE Runtime window, select the Server Registry node.

3. Add (also called Register in Application Server terminology) your admin server by following these steps:

a. Expand the Server Registry node and expand the Installed Servers node.

b. Right-click the Sun Java System Application Server 7 node and choose Add Admin Server from the contextual menu.

The Add Admin Server dialog box is displayed.

Add Admin Server dialog box with no values for Admin Server Host, Port, User Name, Password, and domain1 for Domain. Buttons are OK, Cancel, and Help.

c. Type the values in the text fields.

Contact the superuser or administrator who installed the IDE and created your user admin domain to get these values:


Text Field

Description

Admin Server Host

localhost or local machine name

Admin Server Port

portnumber used in the create-domain command

User Name

useradmin, user name used in the create-domain command

User Password

user, user password used in the create-domain command

Domain

userdomain, used in the create-domain command


d. Click OK.

The following error message might display:


Could not connect to Admin Server. If Admin Server is local it will be started.

e. Click OK to dismiss this error message.

The local admin server is started and your new admin server is added to the IDE. A new admin server node is generated in the Server Registry representing your domain and admin server. You are now ready to create your application server instance.

4. To create the application server instance, follow these steps:

a. In the Runtime window, right-click the new admin server node, identified by the port number you entered, and choose Create a Server Instance from the contextual menu.

The Enter Server Instance Values dialog box is displayed.

Enter Server Instance Values dialog box with no values for Server Instance Name and Server Instance Port. Buttons are OK, Cancel, and Help.

b. Type in a name and an available port number.

For example, MyServer and 50000.



Note - On UNIX systems, the port number 1023 and below are reserved. Use an available port number above 1023. Do not use port numbers used by the default application server or by other applications on your system.



c. Click OK.

A new application server instance is created in the IDE. You can see it by expanding your admin server instance.

5. To set the new server as the default application server and web server, right-click the new application server instance and choose Set As Default.

6. Expand the Default Servers node to verify.

The default servers for J2EE application and web tier applications show the new server as the default.


Other Common Application Server Tasks


procedure icon  To Manually Set the Default Application Server

1. In the IDE's Runtime window, expand the Server Registry node and expand its Default Servers subnode.

If the J2EE Applications node's label is server-instance(machinename:port-number), then Sun Java System Application Server is the default application server. If it is not, continue with the next step.

The Default Servers node in the Runtime window shows the application server is server1(localhost:8080).

2. Find your server instance under the Installed Servers node, right-click the server instance, and choose Set As Default.

Your server is set as the default server for J2EE applications and Web Tier applications.


procedure icon  To Manually Start|Stop the Application Server Instance

1. Right-click the application server node and choose Status from the contextual menu.



Note - If this node is not displayed, your admin server might not be running. Be sure your admin server is running and then try again.



The Sun Java System Application Server Instance Status dialog box is displayed.

Sun Java System Application Server Instance Status window. Buttons are Stop Server, Close, and Help.

2. Click Start | Stop Server as needed.

If the dialog box has a Stop Server button, the server is already running.

The server is started when the Status line shows Running.

3. Click Close.