Build and Deployment

In this section, the build of the web application file and its deployment process is outlined. First how the Anyframe Infrared war file may be compiled is outlined. We need to use the provided pom-minimal.xml file alongside with Maven2 with subversion client already installed. Now, we need to set the paths in the environments in order to use these build tools. After this is done, we compile using "mvn clean" then "mvn pom.xml compile" and then convert the created web application directory with "tar –cvf" command.

The section describes build and deployment procedure of Anyframe Infrared Application and couple of simple test monitored applications.

Prerequisite

  1. SVN client is installed, SVN server certificate is obtained.
  2. Java JDK 1.5 is installed; JAVA_HOME environment variable is set; OS PATH environment variable includes $JAVA_HOME/bin directory.
  3. Maven 2.0.x is installed, MAVEN_HOME environment variable is set; OS PATH environment variable includes $MAVEN _HOME/bin directory.

Building Anyframe Infrared Web Application from Source Code

  1. Getting source code:
    Check out source code of the project as SVN working copy from Exadel SVN repository with URL: https://subversion.exadel.com/svn/samsung/concord/tags/Infrared/Samsung_Infrared_1.0_FCS Go down to web-samsung-gui directory. You will get following directory structure:
  2. Building Anyframe Infrared web application from source code:
    To build application and get WAR file from source code go to web-samsung-gui directory with maven2 build script pom.xml and run command mvn package: web-samsung-gui>mvn package. You can find WAR file into web-samsung-gui/target/ directory: samsung-infrared-web-1.0.war.
    NOTE: if you wish re-build the application, run command mvn clean package instead of command mvn package.

Deployment of Binary Distribution

To deploy WAR file samsung-infrared-web-1.0.war you need to stop the application server, copy WAR file into auto-deployment directory of the server and then start the server. Hot redeployment is not supported due to bug in original Infrared (incorrect stop of HSQL Timer Thread).

Deployment to local Apache Tomcat 5.5.x
You can use tomcat-redeploy-samsung-infrared script provided with sources to deploy to local Apache Tomcat 5.5.x.
  1. Go to web-samsung-gui directory and find file: for Windows: tomcat-redeploy-samsung-infrared.bat
  2. Edit following lines according to your environment: for Windows:
    SET CATALINA_HOME=D:\projects\Anyframe\Infrared\apache-tomcat-5.5.25
    SET SOURCE_DIR=D:\projects\Anyframe\Infrared\svn\modules\web-samsung-gui
    NOTE: utility sleep.exe is absolutely needed to tomcat-redeploy-samsung-infrared.bat
  3. Run tomcat-redeploy-samsung-infrared script. NOTES:
    Be sure that the application server has enough Permanent Generation and Heap memory, e.g.:
    JAVA_OPTS=-XX:PermSize=128m -XX:MaxPermSize=128m -Xms512m -Xmx1024m
    Known issues: If your application server has container managed security and Anyframe Infrared web application under authorization restrictions you will generate report without chart images due to container security restrictions. To prevent this effect allow your server executes URL pattern /chart/ * without authorization. Anyframe Infrared web application uses following patterns:

    /infraRedListenerServlet/*
    /gwt/*
    /report/*
    /chart/*

    So you can restrict access to /infraRedListenerServlet/*, /gwt/*, /report/* but you should open access to /chart/ *. For example, in a case of Apache Tomcat 5.5.x following constraint in web.xml will prohibit loading of images to reports:
    <security-constraint>
    	<web-resource-collection>
    		<web-resource-name>ALL</web-resource-name>
    		<url-pattern>/*</url-pattern>
    	</web-resource-collection>
    	<auth-constraint>
    		<role-name>view_access</role-name>
    	</auth-constraint>
    </security-constraint>
      	  		
    But following constraint will allow loading of images to reports:
    <security-constraint>
    	<web-resource-collection>
    		<web-resource-name>ALL</web-resource-name>
    		<url-pattern>/gwt/*</url-pattern>
    		<url-pattern>/report/*</url-pattern>
    		<url-pattern>/infraRedListenerServlet/*</url-pattern>
    	</web-resource-collection>
    	<auth-constraint>
    		<role-name>view_access</role-name>
    	</auth-constraint>
    </security-constraint>