Skip Headers
Oracle® Fusion Middleware WebLogic Server on JRockit Virtual Edition Installation and Configuration Guide
11g Release 1 (10.3.4)

Part Number E15219-03
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

4 Deploying Applications to WebLogic Server VMs

Once your WebLogic Server VM is running on Oracle VM, you can continue to configure your WebLogic Server domain configuration, as well as deploy applications, in both running and non-running, as described in the following sections.

4.1 Using WebLogic Server Tools to Deploy Applications to Running VMs

You can use the WebLogic Server deployment tools, such as the Administration Console, on your development machine to deploy applications to a virtual domain on a running WebLogic Server VM.

Note:

This section explains how to use the Administration Console to deploy an application; however, you can also deploy applications on a running VM using the weblogic.Deployer tool, the wldeploy Ant task, and WLST. For more information on using these deployment tools, see Deploying Applications to Oracle WebLogic Server.
  1. Start the WebLogic Server virtual machine using WLST, the xm command (xm create -c vm.cfg), or Oracle VM Manager.

  2. From the development machine where the application resides, open a browser and log in to the Administration Server to access the Administration Console of the virtual machine:

    http://admin.server.ip.address:7001/console
    

    where admin.server.ip.address is the IP address assigned to your virtual machine.

  3. If necessary, click Lock & Edit to upload an application to the domain.

  4. Click Deployments, and then click Install.

  5. Click the "upload your file(s)" option to select an application from an existing location on the development machine from which you are currently browsing.

  6. After locating the file, click Next to upload this deployment to the Administration Server.

  7. Install the file as an application.

  8. Select deployment targets and click Next.

  9. From Optional Settings under Source accessibility, select the staging option (that is, the recommended selection).

  10. Click Finish to finish the deployment.

  11. Activate the changes and start the application.

4.2 Accessing Running Virtual Machines Using SSH

You can transfer files to and from the file system of a running virtual machine through the SSH-protocol-based clients, SCP (secure copy) and SFTP (secure FTP). The SSHD service is included in virtual machines built using the Image Tool, but it is not enabled by default.

The section contains the following topics:

4.2.1 Enabling the SSHD Service

WebLogic Server includes a startup class in the classpath that integrates the SSHD service with the WebLogic Server security. For security purposes, you must manually enable and target the SSHD service when using the packaged WebLogic Server VM image as a template for new or migrated domains.

As a best practice, we recommend using the Image Tool to enable the SSHD service on your image template prior to deploying it to Oracle VM. However, you can also transfer a virtual machine from the Oracle VM environment to your Linux development machine, and then use the Image Tool to enable SSHD.

To enable the SSHD service, follow these steps:

  1. Stop the running WebLogic Server VM.

  2. Transfer the VM from the Oracle VM environment to your Linux development machine.

  3. From a command prompt, enter the following Image Tool command to enable the SSHD service.

    java -jar wlsveimagetool.jar -r vm.cfg enable service sshd

  4. Transfer the VM back to the running pool Oracle VM environment.

  5. Restart the WebLogic Server VM on Oracle VM using WLST, the xm command (xm create -c vm.cfg), or Oracle VM Manager.

    When the virtual machine starts, the following message is displayed on the virtual machine console:

    JRockitVE sshd service started (port 22)
    

4.2.1.1 Verify Whether SSHD Is Enabled in the Image Configuration File

Another way to verify whether the SSHD service is enabled, is to check the image configuration file (wlsve.xml) to see if the SSHD service element exists:

<services>
   <service name="sshd"/>
</services>

4.2.1.2 Useful Image Tool Commands for Services

There are two more useful Image Tool commands for WebLogic Server on JRockit VE services.

To view a list of enabled services, enter:

java -jar wlsveimagetool.jar -r vm.cfg get enabled-services

For example, after enabling the SSHD service, you'll see, "sshd (An SSH2 implementation with SCP and SFTP support)".

To disable the SSHD service after it has been enabled, enter:

java -jar wlsveimagetool.jar -r vm.cfg disable service sshd

4.2.2 Deploying and Targeting the SSH Startup Class in a WebLogic Server VM

For security purposes, you must manually enable and target the SSHD service when using the packaged WebLogic Server VM image as a template for new or migrated domains.

4.2.2.1 Using the Administration Console to Deploy and Target the SSH Startup Class

You can use the Administration Console to deploy and target the SSH startup class:

  1. Make sure the WebLogic Server VM is running.

  2. Launch the WebLogic Server Administration Console.

  3. Navigate to the domain (Under the Domain Structure panel on the upper-left), such as mywlsve_domain, Environment, Startup & Shutdown Classes.

  4. In the Summary of Startup and Shutdown Classes table:

    1. Click New.

    2. Select Startup Class.

    3. Enter ssh-startup as the name and weblogic.wlsve.sshserver.SSHStartup as the Class Name.

    4. Select the Target Servers that you want the startup class to run on.

    When ssh-startup appears in the table, then the startup class is properly deployed, as shown in Figure 4-1.

    Figure 4-1 The Startup and Shutdown Classes Table Showing the ssh-startup Class

    Description of Figure 4-1 follows
    Description of "Figure 4-1 The Startup and Shutdown Classes Table Showing the ssh-startup Class"

  5. After adding the ssh-startup information, you must restart WebLogic Server. Even though the Administration Console advises that: All changes have been activated. No restarts are necessary – you must restart the server for the startup class to run and integrate with the SSHD service so that you can connect, authenticate, and use the service.)

4.2.2.2 Checking the WebLogic Server Configuration File to Verify the SSH Startup Class

You can also verify that the SSH startup class is deployed and properly targeted by checking your WebLogic Server configuration file for the following config.xml fragment.

<startup-class>
    <name>ssh-startup</name>
    <target>WlsveAdmin</target>
    <class-name>weblogic.wlsve.sshserver.SSHStartup</class-name>
    <failure-is-fatal>true</failure-is-fatal>
    <load-before-app-deployments>true</load-before-app-deployments>
  </startup-class>

Common SSH Classpath Problems

  • If you get a schema validation error with this fragment in your config.xml, it's likely because the order of elements in the config.xml is important. Try putting the <startup-class> fragment immediately before the <admin-server-name> clause.

  • If you get the exception: java.lang.ClassNotFoundException: weblogic.wlsve.sshserver.SSHStartup, then the SSH startup class JAR is not in the correct location. Verify that com.oracle.weblogic.wlsve.sshstartup_1.0.0.0.jar is in the /application/wlserver_10.3/server/lib/ext directory, where it is automatically added to the classpath. Note that no explicit classpath entry is required since all JARs in /application/wlserver_10.3/server/lib/ext become part of the WebLogic Server's extended classpath.

4.2.3 Using the SSHD Service on a Running VM to Copy and Get Files

Once enabled, the SSHD service permits access to the virtual file system using SFTP and SCP. When used with WebLogic Server VMs, the WebLogic Server authentication mechanisms allow access to the SSH service.

  1. Enable SSH on your WebLogic Server VM by following the steps in Section 4.2.1, "Enabling the SSHD Service."

  2. Start the SSH-enabled WebLogic Server VM on Oracle VM using WLST, the xm command (xm create -c vm.cfg), or Oracle VM Manager.

  3. Using an SFTP or SCP client to connect to the WebLogic Server VM on Oracle VM.

    $ sftp weblogic@hostname/ip-address-of-server
    
  4. The first time you attempt to connect to the VM, you get a host authenticity prompt, as shown in Figure 4-2.

    Figure 4-2 Initial SSH Connection Window

    Description of Figure 4-2 follows
    Description of "Figure 4-2 Initial SSH Connection Window"

  5. Click Yes to continue. Another prompt requests your password, as shown in Figure 4-3.

    Figure 4-3 Enter Password Window

    Description of Figure 4-3 follows
    Description of "Figure 4-3 Enter Password Window"

  6. Enter the password and click OK.

    Note: You may be prompted by both of these messages again.

  7. Once connected, you can browse all the files in your domain (for example, /application/user_projects/domains/mywlsve_domain). You can also navigate through the entire image and put and get the file(s) you need.

  8. Using SFTP get or put files into the running VM.

    Here is an example of using SFTP to get the log file from a running server.

    $ sftp weblogic@<hostname>/<ip-address-of-server>
    Connecting to <ip-addr-of-ssh-server>...
    weblogic@<hostname>/<ip-address-of-server>
    sftp> ls
    autodeploy               bin                      config
    console-ext              edit.lok                 fileRealm.properties
    init-info                lib                      pending
    security                 servers                  startWebLogic.sh
    sftp> pwd
    sftp>cd servers/WlsveAdmin/logs
    
    sftp> get WlsveAdmin.log
    
    Fetching /application/user_projects/domains/
    <mywlsve_domain>/servers/<MyWlsveAdmin>/logs/MyWlsveAdmin.log to WlsveAdmin.log
    /application/user_projects/domains/<mywlsve_doma> 100% 103KB 102.7KB/s 00:00
    
    sftp> bye
    

Notes:

If WebLogic Server is in development mode, then when files are copied to the autodeploy directory, the server may notice the presence of the file before the copy has completed. If this happens, deployment of the archive or exploded directory will start and may fail. To avoid such a failure, Oracle recommends using SFTP to copy the application to a temporary directory outside of the autodeploy directory (for example, tmp/myapp.ear) and then move/rename the file into the autodeploy directory. In production mode, autodeploy is turned off.

If you attempt to connect using SFTP or SCP and get repeated prompts for your password followed by a message, such as Error: The connection could not be made, then one of two things may be wrong: The SSH startup class is not deployed or the SSH startup class is deployed, but not targeted to your server. See Section 4.2.2, "Deploying and Targeting the SSH Startup Class in a WebLogic Server VM."

4.2.4 Configuring WebLogic Server Roles and Policies for SSHD

By default, all users with the Admin role have permission to use the SSH service. If you want additional control over who can perform SSH operations, you can use the Administration Console and do some additional configuration. For example, you can grant specific users permission to use the SSH service to move files back and forth between the WebLogic Server file system and their local file system.

Important! The WebLogic Server user (testadminuser in these instructions) must either already exist or be created in order to grant SSH permissions. Also, the existing/new user must have a role other than the Admin Role, since, by default, all Admin users have permission to use the SSH service. For more information, see Securing Resources Using Roles and Policies for Oracle WebLogic Server.

  1. Use the Domain Structure panel to navigate to the WebLogic Server domain (for example, mywlsve_domain) and click the domain name.

  2. On the Settings page, click the Security tab.

  3. On the ensuing page, click the Policies tab.

  4. Click the SSH tab.

  5. In the Policy Conditions section, click the Add Conditions button.

  6. On the Choose a Predicate page, select User from the Predicate List, and click Next.

  7. Type in the user name (for example, testadmin) in the User Argument Name field, then click Add, and then click Finish.

  8. Click Save.

    Note that an ensuing message may say something like Policy Overridden: Admin, it means that you have eliminated the ability for WebLogic administrator users to use SSH. If you want to retain the ability for an administrator to do SSH, as well as user testadmin, you must update the policy to be User:testadmin or Role:Admin, as shown in Figure 4-4.

    Figure 4-4 Policy Conditions Section of the Security > Policies > SSH Window

    Description of Figure 4-4 follows
    Description of "Figure 4-4 Policy Conditions Section of the Security > Policies > SSH Window"

  9. Try using SFTP or SCP as user testadmin to transfer files to confirm that the new policy setting works.

4.3 Configuring Shared Disk Read-access On NFS to Support the nostage and external_stage Deployment Modes

You can use the Network File System (NFS) to automount and transparently access a read-only shared disk on your network. This way, you can upload your applications to the shared disk where they can be deployed to your WebLogic Server VMs using either the nostage and external_stage deployment modes.

Note:

For instructions on mounting a shared disk on NFS to store WebLogic Server log files, see Section 5.6, "Configuring a Shared Disk On NFS to Store Server Log Files".

For more detailed information on configuring NFS mounts using the Image Tool, see the Image Tool Command-Line Option Reference (the -r option) in the User's Guide for Oracle JRockit Virtual Edition.

4.3.1 Configure the NFS Server and Mounting Points In a Virtual Machine

Before configuring a deployment mode for your VMs, you must configure the NFS server and the VM's mounting points to the read-only shared disk.

  1. On your Linux development machine, configure the NFS Server export directory for the virtual host DNS name/IP Address. For example, add the following to the /etc/exports file:

    <Export dir> <Remote VM Client IP/DNS Address>(<permissions>)
    

    For example:

    /scratch/<userdir>/nfs 10.137.145.92(rw,sync,no_root_squash)
    

    Note: Make sure that the directory you export exists on the NFS location.

  2. Restart the NFS Daemon.

    /etc/init.d/nfs restart
    
  3. Use the Image Tool to create the mounting point in the wlsve.xml configuration file for the virtual machine.

    java -jar wlsveimagetool.jar --reconfigure <vm.cfg> add mount nfs
    <mount-point> <nfs server> <nfs  server-path> <option1> <option2> <...>
    <optionN>
    

    For example:

    java -jar wlsveimagetool.jar --reconfigure vm.cfg add mount nfs /logs
    adc2190200.us.oracle.com /scratch/<userdir>/nfs/logs uid=11735 gid=900
    

4.3.2 Configuring nostage Mode Deployment on NFS

In nostage mode, the Administration Server does not copy the archive files from their source location. Instead, each target server must access the archive files from a single source directory for deployment. The staging directory of target servers is ignored for nostage deployments.

  1. Follow the directions in Section 4.3.1, "Configure the NFS Server and Mounting Points In a Virtual Machine" to configure the NFS server export directory.

  2. Create the Upload directory in the NFS location.

  3. Using the Image tool, create the mounting point in the wlsve.xml configuration file for the upload directories for the VM.

    java -jar wlsveimagetool.jar --reconfigure vm.cfg add mount nfs
    <mount-point> <NFS Server Host> /<NFS Location in Server>/<Upload Directory>
    

    For example:

    java -jar wlsveimagetool.jar --reconfigure vm.cfg add mount nfs
    /application/user_projects/domains/wlsve_domain/servers/WlsveAdmin/upload
    adc2190200.us.oracle.com /scratch/<userdir>/nfs/upload uid=11735 gid=900
    
  4. Transfer the VM image to your Oracle VM environment, and then start the VM using WLST, the xm command (xm create -c vm.cfg), or Oracle VM Manager.

  5. Deploy the application using -nostage.

    • Using the weblogic.Deployer command-line tool:

      java weblogic.Deployer -adminurl t3://<VM Admin Host>:<Admin Port> 
      -user <User Name> -password <Password> -name <App Name> -targets 
      <Server Name/Cluster> -nostage -upload -deploy /<NFS Deploy Location>
      /<Ear/WAR file>
      
    • From the Administration Console. (Refer WLS doc for deployment using Administration Console.)

      While deploying the application, select nostage (it will make the deployment accessible from the following location) and finish the deployment.

    When you deploy an application using nostage mode, deployed applications are available in /<NFS Location in Server>/<Upload Directory>.

    Note: If you are deploying an application to a cluster, make sure that all the Managed Servers in the cluster are configured with the NFS mounting location.

For more information about the nostage deployment mode, see "Controlling Deployment File Copying with Staging Modes" in Deploying Applications and Modules with weblogic.Deployer

4.3.3 Configuring external_stage Mode Deployment on NFS

The Administration Server does not copy deployment files. Instead, the Administrator must ensure that deployment files are distributed to the correct staging directory location before deployment (for example, by manually copying files prior to deployment).

  1. Follow the directions in Section 4.3.1, "Configure the NFS Server and Mounting Points In a Virtual Machine" to configure the NFS server export directory.

  2. Create the Upload and Stage directory in the NFS location.

  3. Using the Image Tool, create the mount point in the wlsve.xml configuration file for the deploy (Upload directory) and stage directories for the VMs

    java -jar wlsveimagetool.jar --reconfigure vm.cfg add mount nfs 
    /<Server_Stage_Dir> <NFS Server host> <NFS_location>/<Stage_directory>
     <Options>
    
    java -jar wlsveimagetool.jar --reconfigure vm.cfg  add mount nfs
    /<Server_Upload_Dir> <NFS Server host> <NFS_location>/<Upload_directory>
    <Options>
    

    Note: Make sure that the <Stage_directory> and <Upload_directory> directories exists on the exported NFS location.

    For example:

    java -jar wlsveimagetool.jar --reconfigure vm.cfg add mount nfs
    /application/user_projects/domains/wlsve_domain/servers/WlsveAdmin/upload
    adc2190200.us.oracle.com /scratch/<userdir>/nfs/deploy uid=11735 gid=900
    
    java -jar wlsveimagetool.jar  --reconfigure vm.cfg add mount nfs
    /application/user_projects/domains/wlsve_domain/servers/WlsveAdmin/stage
    adc2190200.us.oracle.com   /scratch/<userdir>/nfs/stage uid=11735 gid=900
    
  4. On each target server for the deployment, create a subdirectory in the staging directory that has the same name as the deployment name.

    /scratch/<userdir>/nfs/stage/<Application_Name>
    
  5. Copy the deployment files into the newly created staging subdirectories. For example:

    /scratch/<userdir>/nfs/stage/<Application_Name>/ <Application_Name>.ear(.war)
    
  6. Transfer the VM image to your Oracle VM environment, and then start the VM using WLST, the xm command (xm create -c vm.cfg), or Oracle VM Manager.

  7. Deploy the application or module from a remote client using the weblogic.Deployer utility.

    java weblogic.Deployer -adminurl t3://<VM Admin Host>:<Admin Port> 
    -user <User Name> -password <Password> -name <App Name> -targets 
    <Server Names/Cluster Name> -name <Application Name> -external_stage 
    -upload -deploy <WAR/EAR file>
    

For more information about the external_stage deployment mode, see "Controlling Deployment File Copying with Staging Modes" in Deploying Applications and Modules with weblogic.Deployer