Sun GlassFish Web Space Server 10.0 Administration Guide

Deploying Applications to Web Space Server

Sun GlassFish Web Space Server server provides an extensible platform where custom applications which includes portlets, web plugins, hook plugins and theme plugins can be developed (using Netbeans Portal Pack) and deployed to augment the functionality of Web Space Server. The artifacts can be copied into the Hot Deploy directory of Web Space Server. The Hot Deploy listener injects the necessary libraries into the WAR file and deploys them to the GlassFish Enterprise Server by taking advantage of JSR-88 feature or the auto deploy directory feature GlassFish Enterprise Server.

In many production deployments it is possible that the auto deploy is disabled for security reasons or the server is deployed to the GlassFish cluster where the applications should always be deployed to the DAS (Domain Administration Server). In these two cases, copying the WAR files to the Hot Deploy directory for deploying the applications is not possible. To address this scenario of deployment Web Space Server provides a command line tool process.xml that which generate a "massaged" WAR (with all required injections that are otherwise performed by the Hot Deploy listener) that can be manually deployed to the server using asadmin tool.

Deploying Applications Using process.xml

Consider the example of deploying a custom portlet solr-web-5.2.0.1.war to Web Space Server using process.xml.

ProcedureTo Deploy Applications Using process.xml

  1. Copy the custom portlet (solr-web-5.2.0.1.war) into the unprocessed directory located inside the root directory for Web Space Server (the directory to which Web Space Server is unzipped).

    cp solr-web-5.2.0.1 /Webspace_install_root/var/webspace/war-workspace/unprocessed

  2. Navigate to Webspace_install_root/var/webspace/war-workspace folder.

    cd /Webspace_install_root/var/webspace/war-workspace

  3. Run ant -f process.xml.

    Provide the required inputs where necessary. The below screen illustrates the process.


    $ cp solr-web-5.2.0.1 /Webspace_install_dir/var/webspace/war-workspace/unprocessed
    $ cd /Webspace_install_dir/var/webspace/war-workspace
    $ ant -f process.xml 
    Buildfile: process.xml
    
    check-ant:
    
    show-user-warning:
        [input] JAVA_HOME must be set to JDK 1.5 or greater and java must be available for execution. Webcontainer must be stopped. [RETURN to continue or CONTROL-C to stop]
    
    
    set-war-properties:
        [input] Enter war file (include full path)  [/Webspace_install_dir/var/webspace/war-workspace/my.war]
    /Webspace_install_dir/var/webspace/war-workspace/unprocessed/solr-web-5.2.0.1.war
        [input] Is war a portlet, web, theme, hook or layouttemplate?  [portlet]
    web
        [input] Enter deployed war name  [solr-web-5.2.0.1]
    
    
    process:
         [java] Loading jar:file:/Webspace_install_dir/var/webspace/war-workspace/sources/webspace/WEB-INF/lib/portal-impl.jar!/system.properties
         [java] Loading jar:file:/Webspace_install_dir/var/webspace/war-workspace/sources/webspace/WEB-INF/lib/portal-impl.jar!/portal.properties
         [java] Loading jar:file:/Webspace_install_dir/var/webspace/war-workspace/sources/webspace/WEB-INF/lib/enterprise.jar!/portal-sun.properties
         [java] Loading jar:file:/Webspace_install_dir/var/webspace/war-workspace/sources/webspace/WEB-INF/lib/enterprise.jar!/portal-sun-tools.properties
         [java] Loading jar:file:/Webspace_install_dir/var/webspace/war-workspace/sources/webspace/WEB-INF/lib/portal-impl.jar!/captcha.properties
         [java] 2009-04-28 23:39:02,177 [main] INFO  com.liferay.portal.util.PortalImpl - Portal lib directory /opt/wsynergy/ws-root/var/webspace/war-workspace/sources/webspace/WEB-INF/lib/
         [java]   Expanding: /Webspace_install_dir/webspace/war-workspace/unprocessed/solr-web-5.2.0.1.war into /var/tmp/20090428233902276
         [java]   Copying 1 file to /var/tmp/20090428233902276/WEB-INF/classes
         [java]   Copying 1 file to /var/tmp/20090428233902276/WEB-INF/classes
         [java]   Building war: /var/tmp/20090428233903352
         [java] 2009-04-28 23:39:03,944 [main] INFO  com.liferay.portal.kernel.util.ServerDetector - Detected server tomcat
         [java]   Deleting directory /var/tmp/20090428233902276
         [echo] 
         [echo] Processed war is in /Webspace_install_dir/var/webspace/war-workspace/finals.
    
    BUILD SUCCESSFUL
    Total time: 33 seconds