| Sun Java System Application Server |
You might want to create your own samples environment if you are sharing your application server installation with other users or your system user ID does not have write permissions to the area in which the application server is installed. To create your own samples environment:
If the application server was installed as part of a Solaris 9 installation, then you must create your own administrative domain and application server instance in order to work with the product. Additionally, if you are using a shared application server installation, you should create your own administrative domain to avoid any conflicts with other users.
If you already created your own samples environment and created an initial administrative domain and an application server instance by following the Getting Started Guide, then go back to the Sample Applications main page and continue reviewing how to work with the samples.
The Application Server installation that is installed as part of a Solaris 9 installation contains only the necessary libraries, executables and other supporting files required to run an application server. No application server configuration exists upon installation.
To create an initial configuration, you must use the application server's asadmin command line interface (CLI). The create-domain subcommand of the asadmin CLI enables you to create an administrative domain in a location of your choice. Each administrative domain consists of an administrative server and application server instance configurations. When you create an initial administrative domain, you specify the administrative user name, password and port number associated with the administrative server of the domain.
Once you've created an administrative domain, there exists one application server instance within the domain. Each application server instance houses an HTTP server, the J2EE[tm] web and EJB containers and other application server facilities.
By default, the create-domain subcommand creates the new administrative domain configuration under either /var/appserver/domains/ (in the case of the application server installed as part of a Solaris 9 installation) or /var/opt/SUNWappserver8/domains/ (in the case of an unbundled installation of the application server on Solaris). If you are logged in as a user that does not have write permissions to the default domain configuration area, then you must use the --path option to specify a suitable location for the newly created domain when executing the create-domain subcommand.
To create an administrative domain, follow these steps:
|
For a non-root user to create and delete administrative domains, the user ID must be added to the UNIX group that has write permissions to the domain configuration file. By default, the UNIX group asadmin has write privileges to the domain configuration file. Once an administrative domain is created under your user ID, you may execute asadmin subcommands to use the application server instance and perform a wide variety of administrative operations against the application server instance without the user ID belonging to the UNIX group that has write privileges for the administrative domain configuration file. Membership in the group is required only to create and delete administrative domains. |
/usr/sbin directory
(in the case of the application server that is installed as
part of a Solaris 9 installation) or the
install_dir,/bin
directory (in the case of an unbundled install) is included in your
environment's path.asadmin create-domain --domaindir domain_directory --adminport 4848 --adminuser admin --adminpassword Admin_password domain1
Where domain_directory specifies the location under which the administrative domain configuration will be created. The --adminport, --adminuser and --adminpassword options specify the initial settings of the new administrative server defined for the domain.
Upon execution of the create-domain subcommand, you will see the following message:
Created Domain domain1 successfully
If the name "domain1" has already been used, execute the create-domain subcommand again with another domain name. You can use periods and other characters in your domain names. You could use your login user name as a qualifier to help ensure that your domain name is unique. For example, myusernanme.domain1.
If you get this error message:
Cannot create domain: domain1 problem locking store /etc/appserver/domains.lck (Permission denied)
This indicates that your user ID does not have permissions to access the domain configuration files. See the steps above for either adding your user ID to the appropriate UNIX group or requesting that your systems administrator create the administrative domain on your behalf.
asadmin list-domains
The results might look like this:
domain1 running samples not running
The results will show each domain as "running" or "not running."
Once the administrative domain is created, then an application server instance is created in the new administrative domain. Creation of an application server under your own administrative domain does not require that your user ID be part of the UNIX group that has write privileges to the domain configuration files.
Making your own copy of the sample applications involves two basic steps: copying the installed samples to your own area and customizing a set of properties used to interact with an application server instance.
Since the sample applications and the supporting Ant-based build files are contained in a common directory of your application server installation, you can make your own copy of the sample applications by simply copying the following directory to a location in which your user ID has write permissions:
install_dir/samples
Once you make a copy of the samples directory, you must ensure
that the samples/common.properties
file is configured to match your environment. The
common.properties
file specifies the environmental information required by the Ant-based
build facility that is used to build and deploy the sample applications.
| Property | Description |
| admin.host |
The name of the host on which the administrative server resides. For example, localhost if the administrative server is on the local machine. |
| admin.port | The port number on which the administrative server is listening. For example, 4848. |
| admin.user | The administrative user defined for the administrative domain. For example, admin. |
| admin.password |
Administrative user's password. During installation of the application server, this property is not set. You may either choose to set this property or enter the password during each deployment and undeployment operation with the samples. NOTE: Do not use the AS_ADMIN_PASSWORD environment variable to set the password. Use --passwordfile instead. |
| com.sun.aas.installRoot |
Application Server's installation directory. For example, in the case where the application server is installed as part of a Solaris 9 installation, the value of this property should be set to /usr/appserver. |
| com.sun.aas.javaRoot | The location in which a compatible Java[tm] 2 SDK is installed. |
| com.sun.aas.webServicesLib |
Location of the Java web services libraries. For example,
install_dir/lib.
When the application server is installed
as part of a Solaris 9 installation, the value of this
property should be set to
|
| com.sun.aas.imqLib |
Location
of the Message Queue libraries. For example,
When
the application server is installed as part of a Solaris
9 installation, set this property value to |
| appserver.instance |
The name of the application server instance to which sample applications are to be deployed. |
| appserver.instance.port | The HTTP port number on which the application server instance is listening. |
Copyright © 2006 Sun Microsystems, Inc. All rights reserved.