
Administration Commands                                 deploy(1)

NAME
     deploy - deploys the specified component

SYNOPSIS
     deploy
     [--terse={true|false}][ --echo={true|false} ]
     [ --interactive={true|false} ] [ --host  host]
     [--port port] [--secure| -s ] [ --user  admin_user]
     [--passwordfile filename] [--help]
     [ --virtualservers  virtual_servers]
     [--contextroot context_root] [--force=true]
     [ --precompilejsp =false] [ --verify =false]
     [ --name  component_name] [--upload=true]
     [ --retrieve  local_dirpath] [--dbvendorname dbvendorname]
     [--createtables=true|false | --dropandcreatetables=true|false]
     [--uniquetablenames=true|false] [--deploymentplan deployment_plan]
     [--enabled=true] [ --generatermistubs =false]
     [ --availabilityenabled =false]
     [ --libraries  jar_file[(path_separator)jar_file*]]
     [--target target] filepath

DESCRIPTION
     Deploys an  enterprise  application,  web  application,  EJB
     module,  connector  module, or application client module. If
     the component is already deployed or already exists,  it  is
     forcefully redeployed if the --force option is set to true.

     The --createtables  and  --dropandcreatetables  options  are
     booleans and therefore can take the values of true or false.
     These options are only used during deployment of  CMP  beans
     that  have  not been mapped to a database (i.e., no sun-cmp-
     mappings.xml descriptor is provided in the module's META-INF
     directory). They are ignored otherwise.

     The --createtables  and  --dropandcreatetables  options  are
     mutually  exclusive; only one should be used. If drop and/or
     create tables fails, the deployment does not fail; a warning
     message is provided in the log file.

     This command is supported in remote mode only.

OPTIONS
     -t --terse

         Indicates that any output data  must  be  very  concise,
         typically avoiding human-friendly sentences and favoring
         well-formatted data for consumption by a script. Default
         is false.

Java EE 5            Last change: 3 Oct 2008                    1

Administration Commands                                 deploy(1)

     -e --echo

         Setting to true will echo the command line statement  on
         the standard output. Default is false.

     -I --interactive
         If set to true (default),  only  the  required  password
         options are prompted.

     -H --host

         The machine name where the domain administration  server
         is running. The default value is localhost.

     -p --port
         The HTTP/S port for administration. This is the port  to
         which  you  should point your browser in order to manage
         the domain. For example, http://localhost:4848.

         The default port number is 4848.

     -s --secure

         If set to true, uses SSL/TLS  to  communicate  with  the
         domain administration server.

     -u --user
         The authorized domain administration server  administra-
         tive username.

         If you have authenticated to a domain using the  asadmin
         login  command,  then  you  need  not specify the --user
         option  on  subsequent  operations  to  this  particular
         domain.

     --passwordfile

         The --passwordfile option specifies the name,  including
         the full path, of a file containing the password entries
         in a specific format. The entry for  the  password  must
         have  the AS_ADMIN_ prefix followed by the password name
         in uppercase letters.

         For example, to specify the domain administration server
         password,  use  an  entry  with  the  following  format:
         AS_ADMIN_PASSWORD=password, where password is the actual
         administrator  password.  Other  passwords  that  can be

Java EE 5            Last change: 3 Oct 2008                    2

Administration Commands                                 deploy(1)

         specified        include        AS_ADMIN_MAPPEDPASSWORD,
         AS_ADMIN_USERPASSWORD, and AS_ADMIN_ALIASPASSWORD.

         All remote commands must specify the admin  password  to
         authenticate to the domain administration server, either
         through --passwordfile or  asadmin  login,  or  interac-
         tively  on the command prompt. The asadmin login command
         can be used only to  specify  the  admin  password.  For
         other  passwords, that must be specified for remote com-
         mands, use the --passwordfile or enter them at the  com-
         mand prompt.

         If you have authenticated to a domain using the  asadmin
         login command, then you need not specify the admin pass-
         word through the  --passwordfile  option  on  subsequent
         operations  to  this particular domain. However, this is
         applicable only to AS_ADMIN_PASSWORD  option.  You  will
         still  need to provide the other passwords, for example,
         AS_ADMIN_USERPASSWORD, as and when required  by  indivi-
         dual commands, such as update-file-user.

         For security reasons, passwords specified as an environ-
         ment variable will not be read by asadmin.

         The  default  value   for   AS_ADMIN_MASTERPASSWORD   is
         changeit.

     --help

         Displays the help text for the command.

     --virtualservers
         One  or  more  virtual  server  IDs.  Multiple  IDs  are
         separated by commas.

     --contextroot

         Valid only if the archive is a web module. It is ignored
         for  other  archive  types; defaults to filename without
         extension.

     --force
         If set to true, makes sure the component  is  redeployed
         even   if  the  specified  component  has  already  been
         deployed or already exists. The default is true.

Java EE 5            Last change: 3 Oct 2008                    3

Administration Commands                                 deploy(1)

     --precompilejsp

         By default this option is set to false, which  does  not
         allow  the JSP to pre-compile during deployment. Instead
         JSPs are compiled during runtime.

     --verify
         If set to true, the syntax and semantics of the  deploy-
         ment descriptor is verified.

     --name

         Name of the deployable component.

     --upload
         When set to true, uploads the  deployable  file  to  the
         administration  server.  The  deployable  file  imust be
         accessible from the client. If the file is accessible to
         both server and client, set the upload option to false.

     --retrieve

         Retrieves the client  stub  JAR  file  from  the  server
         machine to the local directory.

     --dbvendorname
         Specifies the name of  the  database  vendor  for  which
         tables are created. Supported values include db2, mssql,
         oracle,  derby,  javadb,  postgresql,   pointbase,   and
         sybase,  case-insensitive.   If not specified, the value
         of the database-vendor-name attribute in sun-ejb-jar.xml
         is  used. If no value is specified, a connection is made
         to the resource specifie by the jndi-name subelement  of
         the  cmp-resource  element  in the sun-ejb-jar.xml file,
         and the database vendor name is read. If the  connection
         cannot  be  established,  or  if the value is not recog-
         nized, SQL-92 compliance is presumed.

     --createtables

         Creates tables at  deployment  of  an  application  with
         unmapped  CMP  beans.  Default  is the create-tables-at-
         deploy entry in the cmp-resource  element  of  the  sun-
         ejb-jar.xml file.

Java EE 5            Last change: 3 Oct 2008                    4

Administration Commands                                 deploy(1)

     --dropandcreatetables

         If set to true, when the component  is  redeployed,  the
         tables  created  by  the previous deployment are dropped
         before creating the  new  tables.   Applies  to  already
         deployed  applications  with  unmapped CMP beans. If not
         set to true, the tables are dropped if the  drop-tables-
         at-undeploy  entry  in  the  cmp-resource element of the
         sun-ejb-jar.xml file is set to true. The new tables  are
         created  if  the  create-tables-at-deploy  entry  in the
         cmp-resource element of the sun-ejb-jar.xml file is  set
         to true.

     --uniquetablenames
         Guarantees unique table names  for  all  the  beans  and
         results  in a hashcode added to the table names. This is
         useful if you have an  application  with  case-sensitive
         bean names.

     --deploymentplan

         Takes the deployment plan, which  is  a  JAR  containing
         Sun-specific descriptors, and deploys it. This should be
         passed along when deploying a pure EAR file. A pure  EAR
         file is an EAR without Sun-specific descriptors.

     --enabled
         If set to true (default), allows  users  to  access  the
         application.  If set to false, users will not be able to
         access the application. In a domain whose profile is the
         cluster  profile  or the enterprise profile, this option
         enables the application on the specified target instance
         or  cluster.  If  you  deploy to the target domain, this
         option is ignored, since deploying to the domain doesn't
         deploy to a specific instance or cluster.

     --generatermistubs

         If set to true, static RMI-IIOP stubs are generated  and
         put  into  the client.jar. If set to false (default) the
         stubs are not generated.

     --availabilityenabled
         This option is valid only in domains that are configured
         to  support  clusters,  such as domains that are created
         with the cluster profile or the enterprise profile. This
         option controls whether high-availability is enabled for

Java EE 5            Last change: 3 Oct 2008                    5

Administration Commands                                 deploy(1)

         SFSB checkpointing and potentially passivation.  If  set
         to  false  (default)  all SFSB checkpointing is disabled
         for the specified application or EJB module. If  set  to
         true, the specified application or module is enabled for
         high-availability. Set this option to true only if  high
         availability is configured and enabled at higher levels,
         such as the server and container levels.

     --libraries

         A comma-separated list of library JAR files. Specify the
         library  JAR  files by their relative or absolute paths.
         Specify   relative   paths   relative    to    instance-
         root/lib/applibs.   The  libraries are made available to
         the application in the order specified.

     --target
         This option is valid only in domains that are configured
         to  support  clusters,  such as domains that are created
         with the cluster  profile  or  the  enterprise  profile.
         Specifies  the target to which you are deploying.  Valid
         values are:

             o    server- Specifies the default  server  instance
                  as  the  target.   server  is  the  name of the
                  default server  instance  and  is  the  default
                  value.

             o    domain_name- Specifies a certain domain as  the
                  target.  If domain is the target for an initial
                  deployment, the application is deployed to  the
                  domain,  but  no  server  instances or clusters
                  reference the application.  If  domain  is  the
                  target  for  a redeployment (the --force option
                  is set to true), and dynamic reconfiguration is
                  enabled  for  the  clusters or server instances
                  that reference the application, the referencing
                  clusters  or server instances automatically get
                  the new version of the application.   If  rede-
                  ploying, and dynamic configuration is disabled,
                  the referencing clusters or server instances do
                  not  get  the  new  version  of the application
                  until  the  clustered  or   standalone   server
                  instances are restarted.

             o    cluster_name- Specifies a  certain  cluster  as
                  the target.

             o    instance_name-  Specifies  a   certain   server
                  instance as the target.

Java EE 5            Last change: 3 Oct 2008                    6

Administration Commands                                 deploy(1)

OPERANDS
     filepath

         Path to the deployable file on the local machine if  the
         upload  option  is  set  to true; otherwise the absolute
         path to the file on the server machine.

EXAMPLES
     Example 1 Deploying an Enterprise application

     This syntax deploys the Enterprise application  packaged  in
     the Cart.ear file to the default server instance server.  In
     a domain whose profile is the cluster profile or the  enter-
     prise,  use  the  --target  option  to deploy to a different
     server instance or to a cluster.

       asadmin> deploy --user admin --passwordfile filename Cart.ear
       Command deploy executed successfully

     Example 2 Deploying a Web application with the default  con-
     text root

     This syntax deploys the Web  application  in  the  hello.war
     file  to  the  default  server  instance server. In a domain
     whose profile is the cluster profile or the enterprise,  use
     the --target option to deploy to a different server instance
     or to a cluster.

       asadmin> deploy --user admin --passwordfile myfile hello.war
       Command deploy executed successfully

     Example 3 Deploying an enterprise bean (EJB component)

     Deploy an enterprise bean with container-managed persistence
     (CMP) and create the database tables used by the bean.

     This example uses the --target option,  which  is  available
     only  in  domains  that  are configured to support clusters,
     such as domains that are created with the cluster profile or
     the enterprise profile. To use this example in a domain that
     is not configured to support clusters, omit that option. The

Java EE 5            Last change: 3 Oct 2008                    7

Administration Commands                                 deploy(1)

     target in this example is an existing cluster, cluster1.

       asadmin> deploy --user admin --passwordfile filename
       --createtables=true --target cluster1 EmployeeEJB.jar
       Command deploy executed successfully

     Example 4 Deploying a connector module (resource adapter)

     Deploy a connector module packaged in a RAR file.

     This example uses the --target option,  which  is  available
     only  in  domains  that  are configured to support clusters,
     such as domains that are created with the cluster profile or
     the enterprise profile. To use this example in a domain that
     is not configured to support clusters, omit that option. The
     target  in  this  example  is  an existing standalone server
     instance that does not belong to a cluster.

       asadmin> deploy --user admin --passwordfile filename
       --target myinstance jdbcra.rar
       Command deploy executed successfully

EXIT STATUS
     0                           command executed successfully

     1                           error in executing the command

SEE ALSO
     undeploy(1), list-components(1)

Java EE 5            Last change: 3 Oct 2008                    8

