Sun GlassFish Enterprise Server v3 Administration Guide

Administration Tools

For the most part, you can perform the same tasks by using either the graphical Administration Console or the asadmin command-line utility, however, there are exceptions.

The following Enterprise Server administration tools are described here:

Administration Console

The Administration Console is a browser-based utility that features an easy-to-navigate graphical interface that includes extensive online help for the administrative tasks.

To use the Administration Console, the domain administration server (DAS) must be running. Each domain has its own DAS, which has a unique port number. When Enterprise Server was installed, you chose a port number for the DAS, or used the default port of 4848. You also specified a user name and password if you did not accept the default login (admin with no password).

When specifying the URL for the Administration Console, use the port number for the domain to be administered. The format for starting the Administration Console in a web browser is http://hostname:port. For example:


http://kindness.sun.com:4848

If the Administration Console is running on the host where Enterprise Server was installed, specify localhost for the host name. For example:


http://localhost:4848

For Microsoft Windows, an alternate way to start the Enterprise Server Administration Console is by using the Start menu.

You can display the help material for a page in the Administration Console by clicking the Help button on the page. The initial help page describes the functions and fields of the page itself. Associated task instructions can be accessed on additional pages by clicking a link in the See Also list.

asadmin Utility

The asadmin utility is a command-line tool that runs subcommands for identifying the operation or task that you want to perform. You can run asadmin subcommands either from a command prompt or from a script. Running asadmin subcommands from a script is helpful for automating repetitive tasks. Basic information about how the asadmin utility works can be found in the asadmin(1M) help page. For instructions on using the asadmin utility, see Using the asadmin Utility.

To issue an asadmin subcommand in the standard command shell (single mode), go to the as-install/bin directory and type the asadmin command followed by a subcommand. For example:


asadmin list-jdbc-resources

You can invoke multiple command mode (multimode) by typing asadmin at the command prompt, after which the asadmin> prompt is presented. The asadmin utility continues to accept subcommands until you exit multimode and return to the standard command shell. For example:


asadmin> list-jdbc-resources

You can display a help page for any asadmin subcommand by typing help before the subcommand name. For example:


asadmin> help restart-domain

or


asadmin help restart-domain

A collection of the asadmin help pages is available in HTML and PDF format in the Sun GlassFish Enterprise Server v3 Reference Manual.

REST Interfaces

Enterprise Server provides representational state transfer (REST) interfaces to enable you to access monitoring and configuration data for Enterprise Server, including data that is provided by newly installed add-on components. For more information, see Using REST Interfaces to Administer Enterprise Server.

Update Tool

Enterprise Server provides a set of image packaging system (IPS) tools for updating software on a deployed Enterprise Server. Typical updates include new releases of Enterprise Server, and new or revised releases of Enterprise Server add-on components or modules.

Two distributions are supported for GlassFish Enterprise Server v3: the Web Profile and the Full Platform Profile. After installation, you can view the modules on your system by using the graphical Update Tool or the pkg command.


Note –

If you chose the Web Profile, you can change to the Full Platform Profile by selecting the comparable Full Platform Profile package in Update Tool. All dependent modules are automatically added.


You can add and delete individual modules from a distribution, but such configurations are not supported.

If you need information on upgrading your domain configuration data to work with a new version of Enterprise Server, see Sun GlassFish Enterprise Server v3 Upgrade Guide.

OSGi Module Management Subsystem

The OSGi module management subsystem that is provided with Enterprise Server is the Apache Felix OSGi framework. To enable you to administer this framework, the Apache Felix Remote Shell is enabled by default in Enterprise Server. This shell uses the Felix shell service to interact with the OSGi module management subsystem, and enables you to perform administrative tasks such as:

The Apache Felix Remote Shell is accessible to telnet clients from anywhere in the network. To connect to the Apache Felix Remote Shell through the telnet service, use the telnet(1) command as follows:


telnet host felix-remote-shell-port
host

The host where the DAS is running.

felix-remote-shell-port

The port for connecting to the Apache Felix Remote Shell through the telnet service. Enterprise Server is preconfigured to use port 6666 for this purpose.

To see a list of the commands that are available in the Apache Felix Remote Shell, type help at the Apache Felix Remote Shell prompt.

To exit the Apache Felix Remote Shell, type exit at the Apache Felix Remote Shell prompt.


Example 1–1 Connecting to the Apache Felix Remote Shell

This example connects to the Apache Felix Remote Shell for a domain that is running on the local host and that uses the preconfigured port for connecting to this shell through the telnet service.


telnet localhost 6666

After the connection is established, the following information is displayed:


Connected to localhost.
Escape character is '^]'.

Felix Remote Shell Console:
============================

-> 


Example 1–2 Listing All Installed OSGi Bundles

This example runs the Felix Remote Shell Command ps without any arguments to list all installed OSGi bundles. For better readability, some bundles that would be listed by this example are not shown.


-> ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (2.0.2)
[   1] [Active     ] [    1] HK2 OSGi Main Bundle (1.0.0)
[   2] [Installed  ] [    1] AMX V3 Core (3.0.0.SNAPSHOT)
[   3] [Active     ] [    1] GlassFish Rest Interface (3.0.0.SNAPSHOT)
...
[ 217] [Installed  ] [    1] Admin Console JDBC Plugin (3.0.0.SNAPSHOT)
[ 218] [Resolved   ] [    1] stats77 (3.0.0.SNAPSHOT)
[ 219] [Active     ] [    1] Apache Felix Declarative Services (1.0.8)
[ 220] [Active     ] [    1] GlassFish Web Container (rfc #66) for OSGi Enabled 
Web Applications (3.0.0.SNAPSHOT)
->


Example 1–3 Finding an OSGi Bundle With a Specified Name

This example runs the Felix Remote Shell Command find to find all OSGi bundles whose names contain the text rfc.


-> find rfc
START LEVEL 1
   ID   State         Level  Name
[ 220] [Active     ] [    1] GlassFish Web Container (rfc #66) for OSGi Enabled 
Web Applications (3.0.0.SNAPSHOT)
->


Example 1–4 To Determine the Services That an OSGi Bundle Provides

This example runs the Felix Remote Shell Command inspect with the service option and the capability option to determine the services that OSGi bundle 220 provides.


-> inspect service capability 220 
GlassFish Web Container (rfc #66) for OSGi Enabled Web Applications (220) provides services:
--------------------------------------------------------------------------------------------
objectClass = org.glassfish.osgiweb.Extender
service.id = 30
----
objectClass = org.osgi.service.url.URLStreamHandlerService
service.id = 31
url.handler.protocol = webbundle
-> 

keytool Utility

The keytool utility is used to set up and work with Java Security Socket Extension (JSSE) digital certificates. See Administering JSSE Certificates for instructions on using keytool.

Java Monitoring and Management Console (JConsole)

Java SE provides tools to connect to an MBean server and view the MBeans that are registered with the server. JConsole is one such popular JMX Connector Client and is available as part of the standard Java SE distribution. For instructions on implementing JConsole in the Enterprise Server environment, see Configuring JConsole to View Enterprise Server Monitoring Data.

Application Server Management Extension (AMX)

The application server management eXtension (AMX) API exposes all of the Enterprise Server configuration and monitoring JMX managed beans as easy-to-use client-side dynamic proxies implementing the AMX interfaces.