1
votes

I installed MobileFirst Server v.7 on mac Application Server is WAS v.8.5.5.4. Analytics console is opening but it is showing no data. Server.xml is as follows:

       <?xml version="1.0" encoding="UTF-8"?>
  <server description="new server">

<!-- Enable features -->
<featureManager>
    <feature>jsp-2.2</feature>
    <feature>jdbc-4.0</feature>
    <feature>appSecurity-2.0</feature>
    <feature>servlet-3.0</feature>
    <!-- End of features added by IBM Worklight installer. -->


    <!-- Begin of features added by IBM Worklight <installWorklightAdmin> ant task for context root '/worklightadmin'. -->
    <feature>jdbc-4.0</feature>
    <feature>appSecurity-2.0</feature>
    <feature>restConnector-1.0</feature>

  <!-- Begin of features added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj1'. -->
     <feature>jdbc-4.0</feature>
    <feature>servlet-3.0</feature>
    <feature>ssl-1.0</feature>
    <!-- Begin of features added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj2'. -->
    <feature>jdbc-4.0</feature>
    <feature>servlet-3.0</feature>
    <feature>ssl-1.0</feature>
    <!-- Begin of features added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj3'. -->
    <!-- The following lines will be removed when the application is uninstalled -->
    <feature>jdbc-4.0</feature>
    <feature>servlet-3.0</feature>
    <feature>ssl-1.0</feature>    

   </featureManager>

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint id="defaultHttpEndpoint"
              httpPort="9080"
              httpsPort="9443" host="*" >

    <!-- Option soReuseAddr added by IBM Worklight installer. -->
    <!-- Option soReuseAddr added by IBM Worklight <installWorklightAdmin> ant task for context root '/worklightadmin'. -->
    <!-- Option soReuseAddr added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj1'. -->
    <!-- Option soReuseAddr added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj2'. -->
    <!-- Option soReuseAddr added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj3'. -->
    <tcpOptions soReuseAddr="true"/>

  </httpEndpoint>


  <basicRegistry>
    <!--    Worklight user.
    [Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/worklightadmin'] 
    -->
    <user name="WorklightRESTUser" password="rsRMSUVWwD5h"/>

    <!--    Worklight user.
    [Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/worklightadmin'] 
    -->
    <user name="admin" password="admin"/>

    <!--    Worklight user.
    [Added by IBM Worklight Installation Manager for context root '/applicationcenter'] 
    -->
    <user name="demo" password="demo"/>

    <!--    Worklight user.
    [Added by IBM Worklight Installation Manager for context root '/applicationcenter'] 
    -->
    <user name="appcenteradmin" password="admin"/>

    <!--    IBM Application Center group.
    [Added by IBM Worklight Installation Manager for context root '/applicationcenter'] 
    -->
    <group name="appcentergroup">
        <!--    IBM Application Center group member.
        [Added by IBM Worklight Installation Manager for context root '/applicationcenter'] 
        -->
        <member name="demo"/>

        <!--    IBM Application Center group member.
        [Added by IBM Worklight Installation Manager for context root '/applicationcenter'] 
        -->
        <member name="appcenteradmin"/>

    </group>

   </basicRegistry>

   <!-- Begin of configuration added by IBM Worklight installer. -->

    <!-- Declare the IBM Application Center Console application. -->
    <application id="appcenterconsole" name="appcenterconsole" location="appcenterconsole.war" type="war">
    <application-bnd>
        <security-role name="appcenteradmin">
            <group name="appcentergroup"/>
        </security-role>
    </application-bnd>
   </application>

   <!-- Declare the IBM Application Center Services application. -->
    <application id="applicationcenter" name="applicationcenter" location="applicationcenter.war" type="war">
      <application-bnd>
        <security-role name="appcenteradmin">
            <group name="appcentergroup"/>
        </security-role>
    </application-bnd>
    <classloader delegation="parentLast">
        <commonLibrary>
            <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_1.0.1.jar"/>
        </commonLibrary>
    </classloader>
   </application>

   <jndiEntry jndiName="android.aapt.dir" value='"/Users/kiranjain/IBM/MobileFirst_Platform_Server/ApplicationCenter/tools/android-sdk"'/>

   <!-- Declare the jar files for MySQL access through JDBC. -->
  <library id="MySQLLib">
    <fileset dir="${shared.resource.dir}/mysql" includes="*.jar"/>
  </library>

   <!-- Declare the IBM Application Center database. -->
    <dataSource jndiName="jdbc/AppCenterDS" transactional="false">
    <jdbcDriver libraryRef="MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/APPCNTR" user="admin" password="{xor}PjsyNjE="/>
   </dataSource>

   <!-- End of configuration added by IBM Worklight installer. -->


    <keyStore id="defaultKeyStore" password="worklight"/>

   <administrator-role>

    <user>WorklightRESTUser</user>

   </administrator-role>

    <jndiEntry jndiName="ibm.worklight.admin.jmx.host" value="localhost"/>

   <jndiEntry jndiName="ibm.worklight.admin.jmx.port" value="9443"/>

  <jndiEntry jndiName="ibm.worklight.admin.jmx.user" value="WorklightRESTUser"/>

  <jndiEntry jndiName="ibm.worklight.admin.jmx.pwd" value="rsRMSUVWwD5h"/>

  <jndiEntry jndiName="ibm.worklight.topology.platform" value="Liberty"/>

   <jndiEntry jndiName="ibm.worklight.topology.clustermode" value="Standalone"/>


<webContainer invokeFlushAfterService="false" deferServletLoad="false"/>

<executor id="default" name="LargeThreadPool"
          coreThreads="200" maxThreads="400" keepAlive="60s"
          stealPolicy="STRICT" rejectedWorkPolicy="CALLER_RUNS"/>


   <!-- Declare the IBM Worklight project runtime application. -->
   <application id="MyProj1" name="MyProj1" location="MyProj1.war" type="war">
    <classloader delegation="parentLast">
        <privateLibrary id="worklightlib_MyProj1">
            <fileset dir="${shared.resource.dir}/MyProj1/lib" includes="worklight-jee-library.jar"/>
            <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_1.0.1.jar"/>
        </privateLibrary>
       </classloader>
   </application>
<!-- Declare the JNDI properties for the IBM Worklight project runtime. -->
   <jndiEntry jndiName="MyProj1/publicWorkLightProtocol" value='"http"'/>
   <jndiEntry jndiName="MyProj1/publicWorkLightPort" value='"9080"'/>

   <!-- Declare the jar files for MySQL access through JDBC. -->
   <library id="MyProj1/MySQLLib">
    <fileset dir="${shared.resource.dir}/MyProj1/mysql" includes="mysql-connector-java-5.1.36-bin.jar"/>
   </library>

   <!-- Declare the IBM Worklight Server database. -->
   <dataSource jndiName="MyProj1/jdbc/WorklightDS" transactional="false">
    <jdbcDriver libraryRef="MyProj1/MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/WRKLGHT" user="admin" password="{xor}PjsyNjE="/>
  </dataSource>

    <!-- Declare the IBM Worklight Server reports database. -->
   <dataSource jndiName="MyProj1/jdbc/WorklightReportsDS" transactional="false">
    <jdbcDriver libraryRef="MyProj1/MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/WLREPORT" user="admin" password="{xor}PjsyNjE="/>
  </dataSource>

  <!-- End of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj1'. -->

  <!-- Begin of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj2'. -->

   <!-- Declare the IBM Worklight project runtime application. -->
<application id="MyProj2" name="MyProj2" location="MyProj2.war" type="war">
    <classloader delegation="parentLast">
        <privateLibrary id="worklightlib_MyProj2">
            <fileset dir="${shared.resource.dir}/MyProj2/lib" includes="worklight-jee-library.jar"/>
            <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_1.0.1.jar"/>
        </privateLibrary>
    </classloader>
   </application>

  <!-- Declare the JNDI properties for the IBM Worklight project runtime. -->
  <jndiEntry jndiName="MyProj2/publicWorkLightProtocol" value='"http"'/>
  <jndiEntry jndiName="MyProj2/publicWorkLightPort" value='"9080"'/>

  <!-- Declare the jar files for MySQL access through JDBC. -->
  <library id="MyProj2/MySQLLib">
    <fileset dir="${shared.resource.dir}/MyProj2/mysql" includes="mysql-connector-java-5.1.36-bin.jar"/>
   </library>
   <!-- Declare the IBM Worklight Server database. -->
   <dataSource jndiName="MyProj2/jdbc/WorklightDS" transactional="false">
    <jdbcDriver libraryRef="MyProj2/MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/incident_WRKLGHT" user="admin" password="{xor}PjsyNjE="/>
   </dataSource>

   <!-- Declare the IBM Worklight Server reports database. -->
   <dataSource jndiName="IncidentAware16Jun/jdbc/WorklightReportsDS" transactional="false">
    <jdbcDriver libraryRef="MyProj2/MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/incident_WLREPORT" user="admin" password="{xor}PjsyNjE="/>
  </dataSource>

  <!-- End of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj2'. -->

  <!-- Begin of configuration added by IBM Worklight <installWorklightAdmin> ant task for context root '/worklightadmin'. -->

   <!-- Declare the Worklight Administration Service application. -->
<application id="worklightadmin" name="worklightadmin" location="worklightadmin.war" type="war">
    <application-bnd>
        <security-role name="worklightadmin">
            <user name="admin"/>

        </security-role>

        <security-role name="worklightdeployer">
        </security-role>

        <security-role name="worklightmonitor">
        </security-role>

        <security-role name="worklightoperator">
        </security-role>

    </application-bnd>

    <classloader delegation="parentLast">
        <commonLibrary id="worklightlib_worklightadmin">

            <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_1.0.1.jar"/>
        </commonLibrary>
    </classloader>
</application>

    <application id="analytics" location="analytics.ear" name="analytics" type="ear">
  <application-bnd>
  <security-role name="worklightadmin">
   <user name="admin"/>
  </security-role>
  <security-role name="worklightdeployer">
   <user name="deployer"/>
</security-role>
<security-role name="worklightmonitor">
   <user name="monitor"/>
</security-role>
<security-role name="worklightoperator">
   <user name="operator"/>
  </security-role>
   </application-bnd>
  </application>
  <library id="worklightadmin/MySQLLib">
    <fileset dir="${shared.resource.dir}/worklightadmin/mysql" includes="mysql-connector-java-5.1.36-bin.jar"/>
</library>

  <!-- Declare the IBM Worklight Administration database. -->
<dataSource jndiName="worklightadmin/jdbc/WorklightAdminDS" transactional="false">
    <jdbcDriver libraryRef="worklightadmin/MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/WLADMIN" user="admin" password="{xor}PjsyNjE="/>
</dataSource>
<!-- Declare the Worklight Administration Console application. -->
<application id="worklightconsole" name="worklightconsole" location="worklightconsole.war" type="war">
    <application-bnd>
        <security-role name="worklightadmin">
            <user name="admin"/>

        </security-role>

        <security-role name="worklightdeployer">
        </security-role>

        <security-role name="worklightmonitor">
        </security-role>

        <security-role name="worklightoperator">
        </security-role>

    </application-bnd>

  </application>

   <application id="analytics-service" name="analytics-service" location="analytics-service.war" type="war">
    <application-bnd>
        <security-role name="worklightadmin">
            <user name="admin"/>

        </security-role>

        <security-role name="worklightdeployer">
        </security-role>

        <security-role name="worklightmonitor">
        </security-role>

        <security-role name="worklightoperator">
        </security-role>

    </application-bnd>

   </application>
     <application id="analytics-ui" name="analytics-ui" location="analytics-ui.war" type="war">
    <application-bnd>
        <security-role name="worklightadmin">
            <user name="admin"/>

        </security-role>

        <security-role name="worklightdeployer">
        </security-role>

        <security-role name="worklightmonitor">
        </security-role>

        <security-role name="worklightoperator">
        </security-role>

    </application-bnd>

  </application>
  <!-- Declare the JNDI properties for the Worklight Administration Console. -->
  <jndiEntry jndiName="worklightconsole/ibm.worklight.admin.endpoint" value='"*://*:*/worklightadmin"'/>


<!-- End of configuration added by IBM Worklight <installWorklightAdmin> ant task for context root '/worklightadmin'. -->


<!-- Begin of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/MyProj3'. -->

<!-- Declare the IBM Worklight project runtime application. -->
    <application id="MyProj3" name="MyProj3" location="MyProj3.war" type="war">
    <classloader delegation="parentLast">
        <privateLibrary id="worklightlib_MyProj3">
            <fileset dir="${shared.resource.dir}/MyProj3/lib" includes="worklight-jee-library.jar"/>
            <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_1.0.1.jar"/>
        </privateLibrary>
    </classloader>
</application>

<!-- Declare the JNDI properties for the IBM Worklight project runtime. -->
<jndiEntry jndiName="MyProj3/publicWorkLightProtocol" value='"http"'/>
<jndiEntry jndiName="MyProj3/publicWorkLightPort" value='"9080"'/>
<jndiEntry jndiName="MyProj3/serverSessionTimeout" value='"10"'/>
<jndiEntry jndiName="MyProj3/wl.analytics.url" value='"http://localhost:9080/analytics-service/data"'/>
<jndiEntry jndiName="MyProj3/wl.analytics.console.url" value='"http://localhost:9080/analytics/console"'/>
<jndiEntry jndiName="MyProj3/wl.analytics.username" value='"admin"'/>
<jndiEntry jndiName="MyProj3/wl.analytics.password" value='"admin"'/>
<jndiEntry jndiName="MyProj3/wl.analytics.queue.size" value='"1"'/>


<!-- Declare the jar files for MySQL access through JDBC. -->
  <library id="MyProj3/MySQLLib">
    <fileset dir="${shared.resource.dir}/MyProj3/mysql" includes="mysql-connector-java-5.1.36-bin.jar"/>
</library>

  <!-- Declare the IBM Worklight Server database. -->
  <dataSource jndiName="MyTime/jdbc/WorklightDS" transactional="false">
    <jdbcDriver libraryRef="MyTime/MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/MyTime_WRKLGT" user="admin" password="{xor}PjsyNjE="/>
  </dataSource>

  <!-- Declare the IBM Worklight Server reports database. -->
  <dataSource jndiName="MyTime/jdbc/WorklightReportsDS" transactional="false">
    <jdbcDriver libraryRef="MyTime/MySQLLib"/>
    <properties URL="jdbc:mysql://localhost:3306/MyTime_WRKREPRT" user="admin" password="{xor}PjsyNjE="/>
  </dataSource>
   </server>

I used analytics-ui.war, analytics-service.war and analytics.ear but it is still not working.

I installed 3 projects on MobileFirst Server with adapters but they are not reflecting on the analytics console.

In console.log i am getting below error: Could not start web application analytics-ear. [ERROR ] CWWKZ0002E: An exception occurred while starting the application analytics-ear. The exception message was: com.ibm.ws.container.service.state.StateChangeException: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Context root /analytics/* is already bound. Cannot start application analytics

Initially I set up the mobile first server and deployed my 2 apps than I added the analytics.ear on app folder and made necessary changes in Server.xml. After it I restarted the WAS server. For checking the analytics I deployed MyProj3 with JNDI properties but it is not reflecting on the analytics console. I tried to clean and restart server still it didn't worked.

Help me out with this

1
How long is the server.xml file that your analytics.ear is hosted on? Could you copy/paste the full file or upload it to dropbox for me to take a look at it? - Chevy Hungerford
@Chevy Hungerford thanks for replying. If you are IBM employee I can contact you. - kiran
you can send me the server.xml but I would like to keep support going through SO for users who may experience this issue in the future - Chevy Hungerford
@Chevy Hunferford ..I updated server.xml in my post only. can you check and tell where I am lacking. - kiran
So one issue is that you are binding the two war files to the same context root at the ear file. Do you have the ear file on your server? If you do you can remove the two analytics-*.war files and just use the analytics.ear - Chevy Hungerford

1 Answers

3
votes

Kiran sent me some more logs via email. I believe the failure is a result of this error in the logs:

[ERROR   ] Error sending bulk request: java.lang.RuntimeException: failure in bulk execution:
[0]: index [worklight], type [server_logs], id [3Vuqfw2aTSWqD6g-pw3IkA], message [EsRejectedExecutionException[rejected execution (queue capacity 50) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1@605876e2]]

The way to fix this is to add this jndi entry:

<jndiEntry jndiName="<analytics-context-root>/threadpool.bulk.queue_size" value="1000" />  

Just increase the thread bulk thread pool size to an appropriate number. That number depends on your infrastructure.