My ServerFarm.xml File
<?xml version="1.0" encoding="UTF-8"?>
<Farm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FarmSchema.xsd">
<LibertyNode Hostname="192.168.0.98" ServerID ="server1_farm" AdminPass="demo" AdminUser="demo" JMXPortNumber="9443" />
<LibertyNode Hostname="192.168.0.149" ServerID ="server2_farm" AdminPass="admin" AdminUser="admin" JMXPortNumber="9443" />
</Farm>
My server.xml File
<application id="worklight" name="worklight" location="project2.war" type="war">
<application-bnd>
<security-role name="worklightadmin">
<user name="demo"/>
</security-role>
</application-bnd>
<classloader delegation="parentLast">
<privateLibrary id="worklightlib_worklight">
<fileset dir="${shared.resource.dir}/worklight/lib" includes="worklight-jee-library.jar"/>
<fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_*.jar"/>
</privateLibrary>
<fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_*.jar"/>
</privateLibrary>
</classloader>
</application>
com.worklight.common.util.jmx.LibertyFarmRuntimeMBeanHandler E Exception sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed
Kindly advice.
It may be that you have incorrectly imported the certificate to the keystore. You may follow the instructions in the following post to resolve your issue: https://developer.ibm.com/answers/answers/211204/view.html
Everything i did well. i have miss to exchange the certificate in both servers.
well i have followed IBM MobileFirst 7.1 Configuring a server farm. Let try this like i think it will be hopeful for every one.
Related
I have install properly my MFP 7.1 server and my MFP 7.1 analytics server. They are running on separate machine. I can see that the server logs are being sent to my MFP analytics server, however I cannot see anything on the "Server" tab".
attached are screen shot of 1) MFP analytics server "Adminstration" tab and 2) MFP analytics server "Sever" tab.
admin tab
server tab
Here is my analytics server.xml (FYI, both my MFP servers are installed on top of IBM Liberty)
<server description="simple server">
<application location="analytics.ear"
name="analytics-ear"
type="ear">
<application-bnd>
<security-role name="worklightadmin">
<user name="wlanalytic"/>
</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>
<basicRegistry id="worklight" realm="worklightRealm">
<user name="demo" password="demo"/>
<user name="monitor" password="demo"/>
<user name="deployer" password="demo"/>
<user name="operator" password="demo"/>
<user name="admin" password="admin"/>
<user name="wlanalytic" password="wl_report" />
</basicRegistry>
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>jndi-1.0</feature>
<feature>appSecurity-2.0</feature>
<feature>ssl-1.0</feature>
</featureManager>
<jndiEntry jndiName="analytics/shards" value="6" />
<jndiEntry jndiName="analytics/replicas_per_shard" value="1" />
<jndiEntry jndiName="analytics/http.enabled" value="false" />
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9082"
httpsPort="9445"
accessLoggingRef="accessLogging"/>
<httpAccessLogging id="accessLogging"
logFormat='%h %u %{t}W "%r" %s %b' />
<ssl id="defaultSSLConfig"
keyStoreRef="defaultKeyStore"
trustStoreRef="defaultTrustStore"
clientAuthenticationSupported="true" />
<keyStore id="defaultKeyStore" password="changeit"
location="/default.jks" />
<keyStore id="defaultTrustStore" password="changeit"
location="/TrustCA.jks" />
</server>
Can some IBM MFP expert provide some insight. Thanks
I do not see the JNDI property:
wl.analytics.logs.forward set to true in your server.xml. You should have:
<jndiEntry jndiName="analytics/wl.analytics.logs.forward" value="true" />
You also need to be collecting logs specific to worklight. Analytics is only going to forward server logs from com.ibm.worklight.*
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
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.
I am using mobileFirst CLI for deployment of war file using ant script. Giving the path of mfp-cli web server directory and derby database.
below is my code:
<target name="database">
<configuredatabase kind="Worklight">
<derby database="WRKLGHT" datadir="${path-to-mfpcli}/derby/TestProj"/>
</configuredatabase>
<configuredatabase kind="WorklightReports">
<derby database="WLREPORT" datadir="${path-to-mfpcli}/derby/TestProj"/>
</configuredatabase>
</target>
<target name="install">
<configureapplicationserver id="TestProj" environmentId="TestProj">
<project warfile="${path-to-project}/TestProj.war" libraryfile="${path-to-worklight-jee}/worklight-jee-library-7.0.0.jar"/>
<!-- Here you can define values which override the
default values of Worklight configuration properties -->
<property name="serverSessionTimeout" value="10"/>
<applicationserver>
<websphereapplicationserver installdir="${websphere-server-installed-directory}/wlp" profile="Liberty" user="admin" password="admin">
<server name="worklight"/>
</websphereapplicationserver>
</applicationserver>
<database kind="Worklight">
<derby database="WRKLGHT" datadir="${path-to-mfpcli}/derby/TestProj"/>
</database>
<database kind="WorklightReports">
<derby database="WLREPORT" datadir="${path-to-mfpcli}/derby/TestProj"/>
</database>
</configureapplicationserver>
The server.xml is getting updated as below:
<server description="worklight">
<featureManager>
<feature>servlet-3.0</feature>
<feature>jndi-1.0</feature>
<feature>jdbc-4.0</feature>
<feature>localConnector-1.0</feature>
<feature>restConnector-1.0</feature>
<feature>jsp-2.2</feature>
<feature>appSecurity-1.0</feature>
<feature>ssl-1.0</feature>
</featureManager>
<webContainer invokeFlushAfterService="false" deferServletLoad="false"/>
<webContainer com.ibm.ws.webcontainer.suppressLoggingServiceRuntimeExcep="true" invokeFlushAfterService="false" deferServletLoad="false"/>
<webContainer deferServletLoad="false" invokeFlushAfterService="false"/>
<!-- non standard ports were used to avoid future collision with other WebSphere products. -->
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="10080"
httpsPort="10443" >
<tcpOptions soReuseAddr="true"/>
</httpEndpoint>
<logging consoleLogLevel="AUDIT" copySystemStreams="false"/>
<applicationMonitor updateTrigger="mbean"/>
<executor name="LargeThreadPool" id="default" coreThreads="200" maxThreads="400" keepAlive="60s" stealPolicy="STRICT" rejectedWorkPolicy="CALLER_RUNS"/>
<administrator-role>
<user>admin</user>
</administrator-role>
<keyStore id="defaultKeyStore" password="worklight"/>
<jndiEntry jndiName="ibm.worklight.admin.jmx.host" value="localhost"/>
<jndiEntry jndiName="ibm.worklight.admin.jmx.port" value="10443"/>
<jndiEntry jndiName="ibm.worklight.topology.platform" value="Liberty"/>
<jndiEntry jndiName="ibm.worklight.topology.clustermode" value="Standalone"/>
<application context-root="analytics-service" id="analytics-service" location="analytics-service.war" name="AnalyticsServices" type="war">
<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>
<application context-root="analytics" id="analytics" location="analytics.war" name="Analytics" type="war">
<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>
<!-- Begin of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/worklight'. -->
<!-- Declare the IBM Worklight project runtime application. -->
<application id="worklight" name="worklight" location="TestProj.war" type="war">
<classloader delegation="parentLast">
<privateLibrary id="worklightlib_worklight">
<fileset dir="${shared.resource.dir}/worklight/lib" includes="worklight-jee-library-7.0.0.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="worklight/publicWorkLightProtocol" value='"http"'/>
<jndiEntry jndiName="worklight/publicWorkLightPort" value='"10080"'/>
<jndiEntry jndiName="worklight/ibm.worklight.admin.environmentid" value='"TestProj"'/>
<jndiEntry jndiName="worklight/serverSessionTimeout" value='"10"'/>
<!-- Declare the jar file for Derby with the "embedded" deployment option. -->
<library id="worklight/DerbyLib">
<fileset dir="${shared.resource.dir}/worklight/derby" includes="derby.jar"/>
</library>
<!-- Declare the IBM Worklight Server database. -->
<dataSource jndiName="worklight/jdbc/WorklightDS" transactional="false">
<jdbcDriver libraryRef="worklight/DerbyLib"/>
<properties.derby.embedded databaseName="${path-to-mfpcli}/TestProj/WRKLGHT" user='"WORKLIGHT"'/>
</dataSource>
<!-- Declare the IBM Worklight Server reports database. -->
<dataSource jndiName="worklight/jdbc/WorklightReportsDS" transactional="false">
<jdbcDriver libraryRef="worklight/DerbyLib"/>
<properties.derby.embedded databaseName="${path-to-mfpcli}/TestProj/WLREPORT" user='"WORKLIGHT"'/>
</dataSource>
<!-- End of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/worklight'. -->
But here ID and name of the TestProj.war code in server.xml is "worklight" I am not getting how it came as default value and while running the server the runtime environment is showing as worklight. I am not able to deploy my app because of it as it throws an error MBean not found.
In
<configureapplicationserver id="TestProj" environmentId="TestProj">
You don't need id. This attribute is only used if you deploy in WAS full profile (to add a suffix to the objects created in WAS an allow multipled deployments in a cell)
You probably don't need environmentId. This is used if you deploy several instances of MFP admin in the same applicaiton server. If you add it, the admin must have the same or you have an MBean not found error.
To change the contextRoot, use the attribute contextroot
<configureapplicationserver contextRoot="/TestProj">
For reference, see
https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.reference.doc/devref/r_ant_tasks_configure_appserver_reference.html
I just installed Worklight 6.2 server, use the configuration tool to deploy a simple project and it works OK. Then I followed the instructions in knowledge center to install analytics. Afterwards, when I open WL console in the browser, I got "No runtime can be found." Analytics seems to work fine
My war file is in Liberty apps folder. in my case C:\IBM\WebSphere\Liberty\usr\servers\simpleServer\apps
I have tried the solution below, but didn't work. I removed the files in workarea and checked for my jdk, which is jdk6_45
No runtime on my Worklight 6.2 Console
Here's my server.xml
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<!-- Begin for analytics -->
<feature>jsp-2.2</feature>
<feature>jndi-1.0</feature>
<!-- End for analytics -->
<!-- Begin of features added by IBM Worklight installer. -->
<feature>ssl-1.0</feature>
<feature>servlet-3.0</feature>
<feature>jdbc-4.0</feature>
<feature>appSecurity-1.0</feature>
<feature>jndi-1.0</feature>
<!-- End of features added by IBM Worklight installer. -->
<!-- Begin of features added by IBM Worklight <installWorklightAdmin> ant task for context root '/wladmin'. -->
<feature>ssl-1.0</feature>
<feature>servlet-3.0</feature>
<feature>jdbc-4.0</feature>
<feature>jndi-1.0</feature>
<!-- <feature>restConnector-1.0</feature> -->
<feature>appSecurity-1.0</feature>
<!-- End of features added by IBM Worklight <installWorklightAdmin> ant task for context root '/wladmin'. -->
<!-- Begin of features added by IBM Worklight <configureApplicationServer> ant task for context root '/worklight'. -->
<feature>ssl-1.0</feature>
<feature>servlet-3.0</feature>
<feature>jdbc-4.0</feature>
<feature>jndi-1.0</feature>
<!-- End of features added by IBM Worklight <configureApplicationServer> ant task for context root '/worklight'. -->
</featureManager>
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443" >
<!-- Option soReuseAddr added by IBM Worklight installer. -->
<!-- Option soReuseAddr added by IBM Worklight <installWorklightAdmin> ant task for context root '/wladmin'. -->
<!-- Option soReuseAddr added by IBM Worklight <configureApplicationServer> ant task for context root '/worklight'. -->
<tcpOptions soReuseAddr="true"/>
</httpEndpoint>
<!-- 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>
<!-- Declare the user registry for the IBM Application Center. -->
<basicRegistry id="applicationcenter-registry" realm="ApplicationCenter">
<!-- Worklight user.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<user name="WorklightRESTUser" password="WGFtAaW8fTma"/>
<!-- The users defined here are members of group "appcentergroup",
thus have role "appcenteradmin", and can therefore perform
administrative tasks through the IBM Application Center Console. -->
<user name="appcenteradmin" password="admin"/>
<user name="demo" password="demo"/>
<group name="appcentergroup">
<member name="appcenteradmin"/>
<member name="demo"/>
</group>
</basicRegistry>
<!-- Declare the JNDI properties for the IBM Application Center. -->
<!-- Define the AppCenter services endpoint in order for the AppCenter console to be able to invoke the REST service.
You need to enable this property if the server is behind a reverse proxy
or if the context root of the Application Center Services application is different from '/applicationcenter'. -->
<!-- <jndiEntry jndiName="ibm.appcenter.services.endpoint" value='"http://proxyhost:proxyport/applicationcenter"'/> -->
<!-- The directory with binaries of the 'aapt' program, from the Android SDK's platform-tools package. -->
<jndiEntry jndiName="android.aapt.dir" value='"C:/IBM/Worklight/ApplicationCenter/tools/android-sdk"'/>
<!-- The protocol of the application resources URI. This property is optional. It is only needed if the protocol of the external and internal URI are different. -->
<!-- <jndiEntry jndiName="ibm.appcenter.proxy.protocol" value='"http"'/> -->
<!-- The hostname of the application resources URI. -->
<!-- <jndiEntry jndiName="ibm.appcenter.proxy.host" value='"proxyhost"'/> -->
<!-- The port of the application resources URI. This property is optional. -->
<!-- <jndiEntry jndiName="ibm.appcenter.proxy.port" value="proxyport"/> -->
<!-- Declare the jar files for DB2 access through JDBC. -->
<library id="DB2Lib">
<fileset dir="${shared.resource.dir}/db2" includes="*.jar"/>
</library>
<!-- Declare the IBM Application Center database. -->
<dataSource jndiName="jdbc/AppCenterDS" transactional="false">
<jdbcDriver libraryRef="DB2Lib"/>
<properties.db2.jcc databaseName="APPCNTR" serverName="localhost" portNumber="50000" user="db2admin" password="db2admin"/>
</dataSource>
<!-- End of configuration added by IBM Worklight installer. -->
Ant task for context root '/wladmin']
This configuration is the minimum one that you need to create an SSL configuration.
With this configuration, the Liberty server creates the keystore and the certificate,
if it does not exist yet, during the SSL initialization.
The created certificate is a self-signed certificate that is valid for 365 days.
Do not use the certificates that the Liberty server created for production use.
For more information see http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.wlp.core.doc/ae/twlp_sec_ssl.html
-->
<administrator-role>
<!-- Worklight JMX User.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<user>WorklightRESTUser</user>
</administrator-role>
<!-- Worklight JNDI property for JMX connection.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<jndiEntry jndiName="ibm.worklight.admin.jmx.host" value="localhost"/>
<!-- Worklight JNDI property for JMX connection.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<jndiEntry jndiName="ibm.worklight.admin.jmx.port" value="9443"/>
<!-- Worklight JNDI property for JMX connection.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<jndiEntry jndiName="ibm.worklight.admin.jmx.user" value="WorklightRESTUser"/>
<!-- Worklight JNDI property for JMX connection.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<jndiEntry jndiName="ibm.worklight.admin.jmx.pwd" value="WGFtAaW8fTma"/>
<!-- Worklight JNDI property for JMX connection.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<jndiEntry jndiName="ibm.worklight.topology.platform" value="Liberty"/>
<!-- Worklight JNDI property for JMX connection.
[Added by IBM Worklight <installWorklightAdmin> Ant task for context root '/wladmin']
-->
<jndiEntry jndiName="ibm.worklight.topology.clustermode" value="Standalone"/>
<!-- Begin of configuration added by IBM Worklight <installWorklightAdmin> ant task for context root '/wladmin'. -->
<!-- Declare the Worklight Administration Service application. -->
<application id="wladmin" name="wladmin" location="worklightadmin.war" type="war">
<application-bnd>
<security-role name="worklightadmin">
<user name="demo"/>
</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>
<fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil_1.0.1.jar"/>
</commonLibrary>
</classloader>
</application>
<!-- Declare web container custom properties for the Worklight Administration Service application. -->
<webContainer invokeFlushAfterService="false" deferServletLoad="false"/>
<!-- Declare the JNDI properties for the Worklight Administration Service. -->
<jndiEntry jndiName="wladmin/ibm.worklight.admin.environmentid" value='"Hello_Worklight_Server"'/>
<!-- Declare the jar files for DB2 access through JDBC. -->
<library id="wladmin/DB2Lib">
<fileset dir="${shared.resource.dir}/wladmin/db2" includes="db2jcc4.jar,db2jcc_license_cu.jar"/>
</library>
<!-- Declare the IBM Worklight Administration database. -->
<dataSource jndiName="wladmin/jdbc/WorklightAdminDS" transactional="false">
<jdbcDriver libraryRef="wladmin/DB2Lib"/>
<properties.db2.jcc databaseName="WRKLGHT" serverName="localhost" portNumber="50000" user="db2admin" password="db2admin" currentSchema="WLADMIN"/>
</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="demo"/>
</security-role>
<security-role name="worklightdeployer">
</security-role>
<security-role name="worklightmonitor">
</security-role>
<security-role name="worklightoperator">
</security-role>
</application-bnd>
</application>
<!-- Declare web container custom properties for the Worklight Administration Console application. -->
<webContainer invokeFlushAfterService="false" deferServletLoad="false"/>
<!-- Declare the JNDI properties for the Worklight Administration Console. -->
<jndiEntry jndiName="worklightconsole/ibm.worklight.admin.endpoint" value='"*://*:*/wladmin"'/>
<!-- End of configuration added by IBM Worklight <installWorklightAdmin> ant task for context root '/wladmin'. -->
<!-- Begin of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/worklight'. -->
<!-- Declare the IBM Worklight project runtime application. -->
<application id="worklight" name="worklight" location="HelloWorklight.war" type="war">
<classloader delegation="parentLast">
<privateLibrary>
<fileset dir="${shared.resource.dir}/worklight/lib" includes="worklight-jee-library.jar"/>
</privateLibrary>
</classloader>
</application>
<!-- Declare the JNDI properties for the IBM Worklight project runtime. -->
<jndiEntry jndiName="worklight/publicWorkLightProtocol" value='"http"'/>
<jndiEntry jndiName="worklight/publicWorkLightPort" value='"9080"'/>
<jndiEntry jndiName="worklight/ibm.worklight.admin.environmentid" value='"Hello_Worklight_Server"'/>
<!-- Declare the jar files for DB2 access through JDBC. -->
<library id="worklight/DB2Lib">
<fileset dir="${shared.resource.dir}/worklight/db2" includes="db2jcc4.jar,db2jcc_license_cu.jar"/>
</library>
<!-- Declare the IBM Worklight Server database. -->
<dataSource jndiName="worklight/jdbc/WorklightDS" transactional="false">
<jdbcDriver libraryRef="worklight/DB2Lib"/>
<properties.db2.jcc databaseName="WRKLGHT" serverName="localhost" portNumber="50000" user="db2admin" password="db2admin" currentSchema="WRKLGHT"/>
</dataSource>
<!-- Declare the IBM Worklight Server reports database. -->
<dataSource jndiName="worklight/jdbc/WorklightReportsDS" transactional="false">
<jdbcDriver libraryRef="worklight/DB2Lib"/>
<properties.db2.jcc databaseName="WRKLGHT" serverName="localhost" portNumber="50000" user="db2admin" password="db2admin" currentSchema="WLREPORT"/>
</dataSource>
<!-- For analytics -->
<application context-root="/analytics"
id="analytics"
location="analytics.war"
name="analytics"
type="war">
</application>
<!-- End of configuration added by IBM Worklight <configureApplicationServer> ant task for context root '/worklight'. -->
Worklight still needs the restConnector-1.0 feature in Liberty so you shouldn't comment it out. The analytics delivered in 6.2 cannot run when the restConnector feature is present. You have two options:
Option 1 - Download the latest iFix. The latest iFix comes with a version of analytics that can run with the restConnector feature. You will have to add the 'parentLast' classloader declaration to analytics entry in server.xml. Example:
< application context-root="/analytics" id="analytics"location="analytics.war" name="analytics" type="war">
< classloader delegation="parentLast"/>
</ application>
Option 2 - Install the analytics on a separate liberty server (recommended approach for a production server)
Documentation for the above will be updated in the next fixpack.
As a side note, are you sure that the 'no runtime' error is related to analytics and not just a coincidence? Does the error still occur when you remove analytics and reverse the steps you did for installation?
While deploying a custom war to a WebSphere Liberty profile I get the following exception:
Class org.hsqldb.jdbcDriver not found
I have created and configured the databases by following:
http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fadmin%2Ft_configuring_liberty_profile_for_derby_manually.html
And edited the server.xml file by following:
http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fadmin%2Ft_configuring_liberty_profile_manually.html
In the web.xml of the generated custom war the resource references for the datasources have these values:
<res-ref-name>jdbc/WorklightDS</res-ref-name>
<res-ref-name>jdbc/WorklightReportsDS</res-ref-name>
But the datasources defined in the server xml have these others:
<dataSource jndiName="worklight/jdbc/WorklightDS" transactional="false" statementCacheSize="10">
<dataSource jndiName="worklight/jdbc/WorklightReportsDS" transactional="false" statementCacheSize="10">
Anyway I have tried changing the datasource jndi and I get the same exception.
I have also tried to add to the worklight.properties file the properties wl.db.jndi.name and wl.reports.db.jndi.name without success. I supose these properties are not longer valid in WL6.0.
Also tried adding a file ibm-web-bnd.xml to the generated war.
I guess the problem is related to the binding between the application and the Liberty profile datasources.
The only way I have been able to deploy the custom war is setting the Derby databases in the workligh.properties file.
wl.db.url=jdbc:derby:C:/WebSphere/Worklight60DBs/WRKLGHT;create=true
wl.reports.db.url=jdbc:derby:C:/WebSphere/Worklight60DBs/WLREPORT;create=true
wl.db.username=WORKLIGHT
For the error this is my server.xml:
<featureManager>
<feature>jsp-2.2</feature>
<feature>ssl-1.0</feature>
<feature>servlet-3.0</feature>
<feature>jdbc-4.0</feature>
<feature>appSecurity-1.0</feature>
<feature>jndi-1.0</feature>
</featureManager>
<application id="CaixaProject" name="CaixaProject" location="CaixaProject.war" type="war">
<classloader delegation="parentLast">
<commonLibrary>
<fileset dir="${shared.resource.dir}/lib" includes="worklight-jee-library.jar"/>
</commonLibrary>
</classloader>
</application>
<webContainer invokeFlushAfterService="false"/>
<library id="DerbyLib">
<fileset dir="${shared.resource.dir}/derby" includes="derby.jar"/>
</library>
<dataSource jndiName="jdbc/WorklightDS" transactional="false" statementCacheSize="10">
<jdbcDriver libraryRef="DerbyLib" javax.sql.ConnectionPoolDataSource="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"/>
<properties.derby.embedded databaseName="C:/WebSphere/Worklight60DBs/WRKLGHT" user="WORKLIGHT" shutdownDatabase="false" connectionAttributes="upgrade=true"/>
<connectionManager connectionTimeout="180" maxPoolSize="10" minPoolSize="1" reapTime="180" maxIdleTime="1800" agedTimeout="7200" purgePolicy="EntirePool" />
</dataSource>
<dataSource jndiName="jdbc/WorklightReportsDS" transactional="false" statementCacheSize="10">
<jdbcDriver libraryRef="DerbyLib" javax.sql.ConnectionPoolDataSource="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource"/>
<properties.derby.embedded databaseName="C:/WebSphere/Worklight60DBs/WLREPORT" user="WORKLIGHT" shutdownDatabase="false" connectionAttributes="upgrade=true"/>
<connectionManager connectionTimeout="180" maxPoolSize="10" minPoolSize="1" reapTime="180" maxIdleTime="1800" agedTimeout="7200" purgePolicy="EntirePool" />
</dataSource>
And the only properties I have modified in the worklight.properties file:
publicWorkLightHostname
publicWorkLightProtocol
publicWorkLightPort
How can I deploy a custom war to a Liberty profile using datasources?
Thank you.
is a misleading message. It is related to jndi configuration.
Your jndi references should include CaixaProject in the name
like this in the server.xml
<dataSource jndiName="CaixaProject/jdbc/WorklightDS"
<dataSource jndiName="CaixaProject/jdbc/WorklightReportsDS"
and inside the web.xml is should be like this
<res-ref-name>CaixaProject/jdbc/WorklightDS</res-ref-name>
<res-ref-name>CaixaProject/jdbc/WorklightReportsDS</res-ref-name>
Referece for you Worklight 6.0 does not start on Liberty - HSQLDB