title: ANT Script to deploy a War file in MobileFirst Server to create run time
body: <p>I am using Ant script to deploy a war file in mobile first server to create run time. But I am not sure about the ANT Script, I am getting errors regarding database configuration.</p>
  
  <p>This is the error I am getting by running Ant Script:</p>
  
  <pre><code>     Building project
          command: 'C:\Program Files\agent\opt\apache-ant-1.8.4\bin\ant.bat' -f 'C:\Program Files\agent\var\work\MF-Component\wardeploy.xml'
          Buildfile: C:\Program Files\agent\var\work\MF-Component\wardeploy.xml
  
          install:
          [configureapplicationserver] Logging output of task &lt;configureApplicationServer&gt; to file C:\Users\miracle\Documents\IBM MobileFirst Platform Server Data\Configuration Logs\configureApplicationServer_2016_02_12_03_35_41.log
          [configureapplicationserver] WARNING: The Reports database is deprecated in IBM MobileFirst Platform Foundation since V7.0.0.
          [configureapplicationserver] Use Operational Analytics instead.
          [configureapplicationserver] See http://ibm.biz/knowctr#SSHS8R_7.1.0/com.ibm.worklight.monitor.doc/monitor/c_op_analytics_overview.html
  
          BUILD FAILED
          C:\Program Files\agent\var\work\MF-Component\wardeploy.xml:33: Element &lt;db2&gt; inside &lt;database kind="Worklight"&gt; inside &lt;configureApplicationServer&gt;: Database does not contain the expected tables. The test table GADGET_USER_PREF was not found. 
      You may create the required tables through an invocation of &lt;configureDatabase&gt;.
  
      Total time: 4 seconds
      Caught: com.urbancode.air.ExitCodeException: Command failed with exit code: 1
      com.urbancode.air.ExitCodeException: Command failed with exit code: 1
          at com.urbancode.air.CommandHelper.runCommand(CommandHelper.groovy:195)
          at com.urbancode.air.CommandHelper$runCommand$0.callCurrent(Unknown Source)
          at com.urbancode.air.CommandHelper.runCommand(CommandHelper.groovy:121)
          at com.urbancode.air.CommandHelper$runCommand.call(Unknown Source)
          at ant.run(ant.groovy:123)
  </code></pre>
  
  <p>Here I don't need any tables to deploy the war file but it was asking for table. For deploying the war file it needs to have database. That I have given the credentials but it shows some errors as above.</p>
  
  <p>Here Is the Ant script I am using.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;project basedir="." default="install"&gt;
        &lt;taskdef resource="com/worklight/ant/deployers/antlib.xml"&gt;
          &lt;classpath&gt;
            &lt;pathelement location="C:\Program Files\IBM\MobileFirst_Platform_Server\WorklightServer\worklight-ant-deployer.jar"/&gt;
          &lt;/classpath&gt;
        &lt;/taskdef&gt;
  
        &lt;target name="databases"&gt;
          &lt;configuredatabase kind="Worklight"&gt;
            &lt;db2 database="TESTDB" server="172.17.0.177" user="mobusr4" password="mobileuser4"&gt;
            &lt;/db2&gt;
            &lt;driverclasspath&gt;
              &lt;fileset dir="C:\Program Files\IBM\WebSphere\Liberty\usr\shared\resources\worklight_1\db2"&gt;
                &lt;include name="db2jcc4.jar"/&gt;
                &lt;include name="db2jcc_license_*.jar"/&gt;
              &lt;/fileset&gt;
            &lt;/driverclasspath&gt;
          &lt;/configuredatabase&gt;
          &lt;configuredatabase kind="WorklightReports"&gt;
            &lt;db2 database="TESTDB" server="172.17.0.177" user="mobusr4" password="mobileuser4"&gt;
                    &lt;/db2&gt;
            &lt;driverclasspath&gt;
              &lt;fileset dir="C:\Program Files\IBM\WebSphere\Liberty\usr\shared\resources\worklight_1\db2"&gt;
                &lt;include name="db2jcc4.jar"/&gt;
                &lt;include name="db2jcc_license_*.jar"/&gt;
              &lt;/fileset&gt;
            &lt;/driverclasspath&gt;
          &lt;/configuredatabase&gt;
        &lt;/target&gt;
  
        &lt;target name="install"&gt;
          &lt;configureapplicationserver&gt;
            &lt;project warfile="C:\Program Files\agent\var\work\MF-Component\bin\Git_Demo.war" libraryfile="C:\Program Files\IBM\MobileFirst_Platform_Server\WorklightServer\worklight-jee-library.jar"/&gt;
  
            &lt;!-- Here you can define values which override the 
                 default values of Worklight configuration properties --&gt;
            &lt;property name="serverSessionTimeout" value="10"/&gt;    
  
            &lt;applicationserver&gt;
              &lt;websphereapplicationserver installdir="C:\Program Files\IBM\WebSphere\Liberty"
                                          profile="Liberty"
                                          user="admin" password="admin"&gt;
                &lt;server name="UCDServer"/&gt;
              &lt;/websphereapplicationserver&gt;
            &lt;/applicationserver&gt;
            &lt;database kind="Worklight"&gt;
              &lt;db2 database="TESTDB" server="172.17.0.177" user="mobusr4" password="mobileuser4"/&gt;
              &lt;driverclasspath&gt;
                &lt;fileset dir="C:\Program Files\IBM\WebSphere\Liberty\usr\shared\resources\worklight_1\db2"&gt;
                  &lt;include name="db2jcc4.jar"/&gt;
                  &lt;include name="db2jcc_license_*.jar"/&gt;
                &lt;/fileset&gt;
              &lt;/driverclasspath&gt;
            &lt;/database&gt;
            &lt;database kind="WorklightReports"&gt;
              &lt;db2 database="TESTDB" server="172.17.0.177" user="mobusr4" password="mobileuser4"/&gt;
              &lt;driverclasspath&gt;
                &lt;fileset dir="C:\Program Files\IBM\WebSphere\Liberty\usr\shared\resources\worklight_1\db2"&gt;
                  &lt;include name="db2jcc4.jar"/&gt;
                  &lt;include name="db2jcc_license_*.jar"/&gt;
                &lt;/fileset&gt;
              &lt;/driverclasspath&gt;
            &lt;/database&gt;
          &lt;/configureapplicationserver&gt;
        &lt;/target&gt;
        &lt;/project&gt;
  </code></pre>