JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1-3.1.1 Reference Manual
search filter icon
search icon

Document Information

Preface

Oracle GlassFish Server 3.1 Section 1: asadmin Utility Subcommands

add-resources(1)

apply-http-lb-changes(1)

backup-domain(1)

change-admin-password(1)

change-master-broker(1)

change-master-password(1)

collect-log-files(1)

configure-jms-cluster(1)

configure-lb-weight(1)

configure-ldap-for-admin(1)

copy-config(1)

create-admin-object(1)

create-application-ref(1)

create-audit-module(1)

create-auth-realm(1)

create-backup-config(1)

create-cluster(1)

create-connector-connection-pool(1)

create-connector-resource(1)

create-connector-security-map(1)

create-connector-work-security-map(1)

create-custom-resource(1)

create-domain(1)

create-file-user(1)

create-http(1)

create-http-health-checker(1)

create-http-lb(1)

create-http-lb-config(1)

create-http-lb-ref(1)

create-http-listener(1)

create-http-redirect(1)

create-iiop-listener(1)

create-instance(1)

create-jacc-provider(1)

create-javamail-resource(1)

create-jdbc-connection-pool(1)

create-jdbc-resource(1)

create-jmsdest(1)

create-jms-host(1)

create-jms-resource(1)

create-jndi-resource(1)

create-jvm-options(1)

create-lifecycle-module(1)

create-local-instance(1)

create-message-security-provider(1)

create-network-listener(1)

create-node-config(1)

create-node-ssh(1)

create-password-alias(1)

create-profiler(1)

create-protocol(1)

create-protocol-filter(1)

create-protocol-finder(1)

create-resource-adapter-config(1)

create-resource-ref(1)

create-schedule(1)

create-service(1)

create-ssl(1)

create-system-properties(1)

create-threadpool(1)

create-transport(1)

create-virtual-server(1)

delete-admin-object(1)

delete-application-ref(1)

delete-audit-module(1)

delete-auth-realm(1)

delete-backup-config(1)

delete-cluster(1)

delete-config(1)

delete-connector-connection-pool(1)

delete-connector-resource(1)

delete-connector-security-map(1)

delete-connector-work-security-map(1)

delete-custom-resource(1)

delete-domain(1)

delete-file-user(1)

delete-http(1)

delete-http-health-checker(1)

delete-http-lb(1)

delete-http-lb-config(1)

delete-http-lb-ref(1)

delete-http-listener(1)

delete-http-redirect(1)

delete-iiop-listener(1)

delete-instance(1)

delete-jacc-provider(1)

delete-javamail-resource(1)

delete-jdbc-connection-pool(1)

delete-jdbc-resource(1)

delete-jmsdest(1)

delete-jms-host(1)

delete-jms-resource(1)

delete-jndi-resource(1)

delete-jvm-options(1)

delete-lifecycle-module(1)

delete-local-instance(1)

delete-message-security-provider(1)

delete-network-listener(1)

delete-node-config(1)

delete-node-ssh(1)

delete-password-alias(1)

delete-profiler(1)

delete-protocol(1)

delete-protocol-filter(1)

delete-protocol-finder(1)

delete-resource-adapter-config(1)

delete-resource-ref(1)

delete-schedule(1)

delete-ssl(1)

delete-system-property(1)

delete-threadpool(1)

delete-transport(1)

delete-virtual-server(1)

deploy(1)

deploydir(1)

disable(1)

disable-backup-config(1)

disable-http-lb-application(1)

disable-http-lb-server(1)

disable-monitoring(1)

disable-secure-admin(1)

disable-secure-admin-internal-user(1)

disable-secure-admin-principal(1)

enable(1)

enable-backup-config(1)

enable-http-lb-application(1)

enable-http-lb-server(1)

enable-monitoring(1)

enable-secure-admin(1)

enable-secure-admin-internal-user(1)

enable-secure-admin-principal(1)

export(1)

export-http-lb-config(1)

export-sync-bundle(1)

flush-connection-pool(1)

flush-jmsdest(1)

freeze-transaction-service(1)

generate-jvm-report(1)

get(1)

get-client-stubs(1)

get-health(1)

import-sync-bundle(1)

install-node(1)

jms-ping(1)

list(1)

list-admin-objects(1)

list-application-refs(1)

list-applications(1)

list-audit-modules(1)

list-auth-realms(1)

list-backup-configs(1)

list-backups(1)

list-clusters(1)

list-commands(1)

list-components(1)

list-configs(1)

list-connector-connection-pools(1)

list-connector-resources(1)

list-connector-security-maps(1)

list-connector-work-security-maps(1)

list-containers(1)

list-custom-resources(1)

list-domains(1)

list-file-groups(1)

list-file-users(1)

list-http-lb-configs(1)

list-http-lbs(1)

list-http-listeners(1)

list-iiop-listeners(1)

list-instances(1)

list-jacc-providers(1)

list-javamail-resources(1)

list-jdbc-connection-pools(1)

list-jdbc-resources(1)

list-jmsdest(1)

list-jms-hosts(1)

list-jms-resources(1)

list-jndi-entries(1)

list-jndi-resources(1)

list-jvm-options(1)

list-lifecycle-modules(1)

list-log-attributes(1)

list-log-levels(1)

list-message-security-providers(1)

list-modules(1)

list-network-listeners(1)

list-nodes(1)

list-nodes-config(1)

list-nodes-ssh(1)

list-password-aliases(1)

list-persistence-types(1)

list-probes(1)

list-protocol-filters(1)

list-protocol-finders(1)

list-protocols(1)

list-resource-adapter-configs(1)

list-resource-refs(1)

list-schedules(1)

list-secure-admin-internal-users(1)

list-secure-admin-principals(1)

list-sub-components(1)

list-supported-cipher-suites(1)

list-system-properties(1)

list-threadpools(1)

list-timers(1)

list-transports(1)

list-virtual-servers(1)

list-web-context-param(1)

list-web-env-entry(1)

login(1)

migrate-timers(1)

monitor(1)

multimode(1)

ping-connection-pool(1)

ping-node-ssh(1)

recover-transactions(1)

redeploy(1)

restart-domain(1)

restart-instance(1)

restart-local-instance(1)

restore-domain(1)

resume-domain(1)

rollback-transaction(1)

rotate-log(1)

run-script(1)

set(1)

set-log-attributes(1)

set-log-levels(1)

setup-ssh(1)

set-web-context-param(1)

set-web-env-entry(1)

show-component-status(1)

start-cluster(1)

start-database(1)

start-domain(1)

start-instance(1)

start-local-instance(1)

stop-cluster(1)

stop-database(1)

stop-domain(1)

stop-instance(1)

stop-local-instance(1)

suspend-domain(1)

undeploy(1)

unfreeze-transaction-service(1)

uninstall-node(1)

unset(1)

unset-web-context-param(1)

unset-web-env-entry(1)

update-admin-server-coordinates(1)

update-admin-server-local-coordinates(1)

update-connector-security-map(1)

update-connector-work-security-map(1)

update-file-user(1)

update-node-config(1)

update-node-ssh(1)

update-password-alias(1)

uptime(1)

validate-multicast(1)

verify-domain-xml(1)

version(1)

Oracle GlassFish Server 3.1 Section 1M: Utility Commands

Oracle GlassFish Server 3.1 Section 5ASC: GlassFish Server Concepts

Oracle GlassFish Server 3.1 Section 5GFP: Events

Index

create-domain

- creates a domain

Synopsis

create-domain [--help] 
[--adminport adminport]
[--instanceport instanceport] 
[--portbase portbase] 
[--profile profile-name] 
[--template template-name] 
[--domaindir domaindir] 
[--savemasterpassword={false|true}] 
[--usemasterpassword={false|true}]
[--domainproperties (name=value)[:name=value]*] 
[--keytooloptions (name=value)[:name=value]*] 
[--savelogin={false|true}] 
[--checkports={true|false}] 
[--nopassword={false|true}] 
domain-name

Description

The create-domain subcommand creates a GlassFish Server domain. A domain in GlassFish Server is an administrative namespace that complies with the Java Platform, Enterprise Edition (Java EE) standard. Every domain has a configuration, which is stored in a set of files. Any number of domains, each of which has a distinct administrative identity, can be created in a given installation of GlassFish Server. A domain can exist independently of other domains.

Any user who has access to the asadmin utility on a given system can create a domain and store its configuration in a folder of the user's choosing. By default, the domain configuration is created in the default directory for domains. You can override this location to store the configuration elsewhere.

If domain customizers are found in JAR files in the as-install/modules directory when the create-domain subcommand is run, the customizers are processed. A domain customizer is a class that implements the DomainInitializer interface.

The create-domain subcommand creates a domain with a single administrative user specified by the asadmin utility option --user. If the --user option is not specified, and the --nopassword option is set to true, the default administrative user, admin, is used. If the --nopassword option is set to false (the default), a username is required. In this case, if you have not specified the user name by using the --user option, you are prompted to do so.

This subcommand is supported in local mode only.

Options

--help
-?

Displays the help text for the subcommand.

--adminport

The HTTP port or the HTTPS port for administration. This port is the port in the URL that you specify in your web browser to manage the domain, for example, http://localhost:4949. The --adminport option cannot be used with the --portbase option. The default value is 4848.

The --adminport option overrides the domain.adminPort property of the --domainproperties option.

--instanceport

The domain provides services so that applications can run when deployed. This HTTP port specifies where the web application context roots are available for a web browser to connect to. This port is a positive integer and must be available at the time of domain creation. The --instanceport option cannot be used with the --portbase option. The default value is 8080.

The --instanceport option overrides the domain.instancePort property of the --domainproperties option.

--portbase

Determines the number with which port assignments should start. A domain uses a certain number of ports that are statically assigned. The portbase value determines where the assignment should start. The values for the ports are calculated as follows:

  • Administration port: portbase + 48

  • HTTP listener port: portbase + 80

  • HTTPS listener port: portbase + 81

  • JMS port: portbase + 76

  • IIOP listener port: portbase + 37

  • Secure IIOP listener port: portbase + 38

  • Secure IIOP with mutual authentication port: portbase + 39

  • JMX port: portbase + 86

  • JPDA debugger port: portbase + 9

  • Felix shell service port for OSGi module management: portbase + 66

When the --portbase option is specified, the output of this subcommand includes a complete list of used ports.

The --portbase option cannot be used with the --adminport, --instanceport, or the --domainproperties option.

--profile

Do not specify this option. This option is retained for compatibility with earlier releases. If you specify this option, a syntax error does not occur. Instead, the subcommand runs successfully and displays a warning message that the option is ignored.

--template

The file name, including a relative or absolute path, of a domain configuration template to use for creating the domain. If a relative path is specified, the subcommand appends the path to the as-install/glassfish/lib/templates directory to locate the file. If it is an absolute pathname, the subcommand locates the file in the specified path.

This option enables domains of different types to be created and custom domain templates to be defined.

--domaindir

The directory where the domain is to be created. If specified, the path must be accessible in the filesystem. If not specified, the domain is created in the default domain directory, as-install/domains.

--savemasterpassword

Setting this option to true allows the master password to be written to the file system. If this option is true, the --usemasterpassword option is also true, regardless of the value that is specified on the command line. The default value is false.

A master password is really a password for the secure key store. A domain is designed to keep its own certificate (created at the time of domain creation) in a safe place in the configuration location. This certificate is called the domain's SSL server certificate. When the domain is contacted by a web browser over a secure channel (HTTPS), this certificate is presented by the domain. The master password is supposed to protect the store (a file) that contains this certificate. This file is called keystore.jks and is created in the configuration directory of the domain created. If however, this option is chosen, the master password is saved on the disk in the domain's configuration location. The master password is stored in a file called master-password, which is a Java JCEKS type keystore. The reason for using the --savemasterpassword option is for unattended system boots. In this case, the master password is not prompted for when the domain starts because the password will be extracted from this file.

It is best to create a master password when creating a domain, because the master password is used by the start-domain subcommand. For security purposes, the default setting should be false, because saving the master password on the disk is an insecure practice, unless file system permissions are properly set. If the master password is saved, then start-domain does not prompt for it. The master password gives an extra level of security to the environment.

--usemasterpassword

Specifies whether the key store is encrypted with a master password that is built into the system or a user-defined master password.

If false (default), the keystore is encrypted with a well-known password that is built into the system. Encrypting the keystore with a password that is built into the system provides no additional security.

If true, the subcommand obtains the master password from the AS_ADMIN_MASTERPASSWORD entry in the password file or prompts for the master password. The password file is specified in the --passwordfile option of the asadmin(1M)utility.

If the --savemasterpassword option is true, this option is also true, regardless of the value that is specified on the command line.

--domainproperties

Setting the optional name/value pairs overrides the default values for the properties of the domain to be created. The list must be separated by the colon (:) character. The --portbase options cannot be used with the --domainproperties option. The following properties are available:

domain.adminPort

This property specifies the port number of the HTTP port or the HTTPS port for administration. This port is the port in the URL that you specify in your web browser to manage the instance, for example, http://localhost:4949. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

The domain.adminPort property is overridden by the --adminport option.

domain.instancePort

This property specifies the port number of the port that is used to listen for HTTP requests. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

The domain.instancePort property is overridden by --instanceport option.

domain.jmxPort

This property specifies the port number on which the JMX connector listens. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

http.ssl.port

This property specifies the port number of the port that is used to listen for HTTPS requests. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

java.debugger.port

This property specifies the port number of the port that is used for connections to the Java Platform Debugger Architecture (JPDA) debugger. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

jms.port

This property specifies the port number for the Java Message Service provider. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

orb.listener.port

This property specifies the port number of the port that is used for IIOP connections. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

orb.mutualauth.port

This property specifies the port number of the port that is used for secure IIOP connections with client authentication. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

orb.ssl.port

This property specifies the port number of the port that is used for secure IIOP connections. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

osgi.shell.telnet.port

This property specifies the port number of the port that is used for connections to the Apache Felix Remote Shell. This shell uses the Felix shell service to interact with the OSGi module management subsystem. Valid values are 1–65535. On UNIX, creating sockets that listen on ports 1–1024 requires superuser privileges.

--keytooloptions

Specifies an optional list of name-value pairs of keytool options for a self-signed server certificate. The certificate is generated during the creation of the domain. Each pair in the list must be separated by the colon (:) character.

Allowed options are as follows:

CN

Specifies the common name of the host that is to be used for the self-signed certificate. This option name is case insensitive.

By default, the name is the fully-qualified name of the host where the create-domain subcommand is run.

--savelogin

If set to true, this option saves the administration user name and password. Default value is false. The username and password are stored in the .asadminpass file in user's home directory. A domain can only be created locally. Therefore, when using the --savelogin option, the host name saved in .asadminpass is always localhost. If the user has specified default administration port while creating the domain, there is no need to specify --user, --passwordfile, --host, or --port on any of the subsequent asadmin remote commands. These values will be obtained automatically.


Note - When the same user creates multiple domains that have the same administration port number on the same or different host (where the home directory is NFS mounted), the subcommand does not ask if the password should be overwritten. The password will always be overwritten.


--checkports

Specifies whether to check for the availability of the administration, HTTP, JMS, JMX, and IIOP ports. The default value is true.

--nopassword

Specifies whether the administrative user will have a password. If false (the default), the password is specified by the AS_ADMIN_PASSWORD entry in the asadmin password file (set by using the --passwordfile option). If false and the AS_ADMIN_PASSWORD is not set, you are prompted for the password.

If true, the administrative user is created without a password. If a user name for the domain is not specified by using the --user option, and the --nopassword option is set to true, the default user name, admin, is used.

Operands

domain-name

The name of the domain to be created. The name may contain only ASCII characters and must be a valid directory name for the operating system on the host where the domain is created.

Examples

Example 1 Creating a Domain

This example creates a domain named domain4.

asadmin>create-domain --adminport 4848 domain4
Enter admin user name [Enter to accept default "admin" / no password]>
Using port 4848 for Admin.
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=sr1-usca-22,OU=GlassFish,O=Oracle Corp.,L=Redwood Shores,ST=California,C=US]
No domain initializers found, bypassing customization step
Domain domain4 created.
Domain domain4 admin port is 4848.
Domain domain4 allows admin login as user "admin" with no password.
Command create-domain executed successfully.

Example 2 Creating a Domain in an Alternate Directory

This example creates a domain named sampleDomain in the /home/someuser/domains directory.

asadmin>  create-domain --domaindir /home/someuser/domains --adminport 7070 
--instanceport 7071 sampleDomain
Enter admin user name [Enter to accept default "admin" / no password]>
Using port 7070 for Admin.
Using port 7071 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Enterprise ServiceDistinguished Name of the self-signed X.509 Server Certificate is:
[CN=sr1-usca-22,OU=GlassFish,O=Oracle Corp.,L=Redwood Shores,ST=California,C=US]
No domain initializers found, bypassing customization step
Domain sampleDomain created.
Domain sampleDomain admin port is 7070.
Domain sampleDomain allows admin login as user "admin" with no password.
Command create-domain executed successfully.

Example 3 Creating a Domain and Saving the Administration User Name and Password

This example creates a domain named myDomain and saves the administration username and password.

asadmin> create-domain --adminport 8282 --savelogin=true myDomain
Enter the admin password [Enter to accept default of no password]>
Enter the master password [Enter to accept default password "changeit"]>
Using port 8282 for Admin.
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Enterprise ServiceDistinguished Name of the self-signed X.509 Server Certificate is:
[CN=sr1-usca-22,OU=GlassFish,O=Oracle Corp.,L=Redwood Shores,ST=California,C=US]
No domain initializers found, bypassing customization step
Domain myDomain created.
Domain myDomain admin port is 8282.
Domain myDomain allows admin login as user "admin" with no password.
Login information relevant to admin user name [admin]
for this domain [myDomain] stored at
[/home/someuser/.asadminpass] successfully.
Make sure that this file remains protected.
Information stored in this file will be used by
asadmin commands to manage this domain.
Command create-domain executed successfully.

Example 4 Creating a Domain and Designating the Certificate Host

This example creates a domain named domain5. The common name of the host that is to be used for the self-signed certificate is trio.

asadmin> create-domain --adminport 9898 --keytooloptions CN=trio domain5
Enter the admin password [Enter to accept default of no password]>
Enter the master password [Enter to accept default password "changeit"]>
Using port 9898 for Admin.
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=trio,OU=GlassFish,O=Oracle Corp.,L=Redwood Shores,ST=California,C=US]
No domain initializers found, bypassing customization step
Domain domain5 created.
Domain domain5 admin port is 9898.
Domain domain5 allows admin login as user "admin" with no password.
Command create-domain executed successfully.

Exit Status

0

subcommand executed successfully

1

error in executing the subcommand

See Also

login(1), delete-domain(1), start-domain(1), stop-domain(1), list-domains(1)

asadmin(1M)

Apache Felix Remote Shell, Java Platform Debugger Architecture (JPDA)