Search code examples
ibm-mobilefirstworklight-server

Multiple Worklight servers on single host configuration


I have setup 2 worklight liberty servers ('worklight' and 'customer') - I have changed the port from 9080 to 9081 in server.xml for the customer server and installed runtimes in both environments.

Each server has unique schema when created as well as unique context paths

My issue is that I can see both my runtimes working in the worklight server console, but I get 'No runtime can be found.' error message when I access the customer console

What else needs to be configured in order for this to work?

  • Using Worklight 6.2 (fixpack 3) Liberty Server
  • Windows Server
  • Server configuration tool used to create everything

messages.log:

[11/25/14 15:49:46:087 GMT] 0000001d com.worklight.server.bundle.project.JeeProjectActivator      I FWLST0002I: ========= Project /customerproject started. The project WAR file version is 6.2.0.00.20140613-0730,running on server version 6.2.0.00.20140613-0730. [project customerproject]
    [11/25/14 15:49:46:087 GMT] 0000001d SystemOut                                                    O ================ End init of customerproject  18517
    [11/25/14 15:49:46:181 GMT] 0000001d org.apache.wink.server.internal.servlet.RestServlet          I The system is using the com.worklight.oauth.AuthorizationServerApplication JAX-RS application class that is named in the javax.ws.rs.Application init-param initialization parameter.
    [11/25/14 15:49:46:321 GMT] 0000001a com.worklight.common.util.jmx.LibertyJMXRegister             I FWLSE2008I: MBean registration succeeded for: com.worklight.common.server.jmx.api:type=ProjectManagement_customer,qualifier=advancedproject2 [project advancedproject2]
    [11/25/14 15:49:46:337 GMT] 0000001a SystemOut                                                    O Cleanup dir is C:\IBMX64\WebSphere\Liberty\usr\servers\customer\workarea\org.eclipse.osgi\bundles\79\data\temp\default_node\SMF_WebContainer\advancedproject2\advancedproject\widget-resources
    [11/25/14 15:49:46:352 GMT] 0000001d apache.wink.server.internal.application.ApplicationProcessor I The following JAX-RS application has been processed: com.worklight.oauth.AuthorizationServerApplication
    [11/25/14 15:49:46:368 GMT] 0000001d org.apache.wink.server.internal.log.Resources                I The server has registered the JAX-RS resource class com.worklight.oauth.TokenValidationEndpoint with @Path(/validation).
    [11/25/14 15:49:46:368 GMT] 0000001d org.apache.wink.server.internal.log.Resources                I The server has registered the JAX-RS resource class com.worklight.oauth.TokenEndpoint with @Path(/token).
    [11/25/14 15:49:46:368 GMT] 0000001d org.apache.wink.server.internal.log.Providers                I There are no custom JAX-RS providers defined in the application.
    [11/25/14 15:49:46:383 GMT] 0000001a com.worklight.common.util.jmx.RuntimeMBeanHandler            W Impossible to decode the password
    [11/25/14 15:49:46:415 GMT] 0000001a com.worklight.server.bundle.project.JeeProjectActivator      I FWLST0002I: ========= Project /advancedproject2 started. The project WAR file version is 6.2.0.00.20140613-0730,running on server version 6.2.0.00.20140613-0730. [project advancedproject2]
    [11/25/14 15:49:46:415 GMT] 0000001a SystemOut                                                    O ================ End init of advancedproject2  16599
    [11/25/14 15:49:46:555 GMT] 0000001a org.apache.wink.server.internal.servlet.RestServlet          I The system is using the com.worklight.oauth.AuthorizationServerApplication JAX-RS application class that is named in the javax.ws.rs.Application init-param initialization parameter.
    [11/25/14 15:49:46:805 GMT] 0000001d com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [customerproject] [/customerproject] [AuthorizationServer]: Initialization successful.
    [11/25/14 15:49:46:805 GMT] 0000001d com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application customerproject started in 26.351 seconds.
    [11/25/14 15:49:46:898 GMT] 0000001a apache.wink.server.internal.application.ApplicationProcessor I The following JAX-RS application has been processed: com.worklight.oauth.AuthorizationServerApplication
    [11/25/14 15:49:46:976 GMT] 0000001a org.apache.wink.server.internal.log.Resources                I The server has registered the JAX-RS resource class com.worklight.oauth.TokenValidationEndpoint with @Path(/validation).
    [11/25/14 15:49:46:976 GMT] 0000001a org.apache.wink.server.internal.log.Resources                I The server has registered the JAX-RS resource class com.worklight.oauth.TokenEndpoint with @Path(/token).
    [11/25/14 15:49:46:976 GMT] 0000001a org.apache.wink.server.internal.log.Providers                I There are no custom JAX-RS providers defined in the application.
    [11/25/14 15:49:47:319 GMT] 0000001a com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [advancedproject2] [/advancedproject2] [AuthorizationServer]: Initialization successful.
    [11/25/14 15:49:47:335 GMT] 0000001a com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application advancedproject2 started in 26.881 seconds.
    [11/25/14 15:49:47:382 GMT] 00000016 com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0008I: Feature update completed in 31.270 seconds.
    [11/25/14 15:49:47:382 GMT] 00000016 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The server customer is ready to run a smarter planet.
    [11/25/14 15:49:57:159 GMT] 0000001d com.ibm.worklight.dataaccess.datastore.DataStoreUtil         I getWorklightDataSourceProperties Read properties file. allProperties: {ibm.worklight.admin.db.jndi.name=java:comp/env/jdbc/WorklightAdminDS}
    [11/25/14 15:49:57:159 GMT] 0000001d com.ibm.worklight.dataaccess.datastore.DataStoreUtil         I dereferenceProperties Handling propName=ibm.worklight.admin.db.jndi.name propValue=java:comp/env/jdbc/WorklightAdminDS
    [11/25/14 15:49:57:159 GMT] 0000001d com.ibm.worklight.dataaccess.datastore.DataStoreUtil         I dereferenceProperties Handling propName=ibm.worklight.admin.db.openjpa.Log propValue=
    [11/25/14 15:49:57:159 GMT] 0000001d com.ibm.worklight.dataaccess.datastore.DataStoreUtil         I dereferenceProperties Handling propName=ibm.worklight.admin.db.type propValue=
    [11/25/14 15:49:57:159 GMT] 0000001d com.ibm.worklight.dataaccess.datastore.DataStore             I constructor Creating EntityManagerFactory for persistence-unit=WorklightManagementPU-db2 with properties: {openjpa.ConnectionFactory=com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource@5aaacacc}
    [11/25/14 15:49:57:299 GMT] 0000001d SystemErr                                                    R 31  WorklightManagementPU-db2  INFO   [Default Executor-thread-4] openjpa.Runtime - Starting OpenJPA 1.2.2
    [11/25/14 15:49:57:315 GMT] 0000001d SystemErr                                                    R 47  WorklightManagementPU-db2  INFO   [Default Executor-thread-4] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.DB2Dictionary" (DB2/NT64 SQL10010 ,IBM Data Server Driver for JDBC and SQLJ 4.13.127).
    [11/25/14 15:49:57:455 GMT] 0000001d com.worklight.common.util.jmx.RuntimeMBeanHandler            W Impossible to decode the password
    [11/25/14 15:49:57:486 GMT] 0000001d com.ibm.worklight.admin.services.RuntimeService              E Failed to obtain JMX connection to access an MBean.
    There might be a JMX configuration error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    [11/25/14 15:49:57:720 GMT] 0000001d com.ibm.worklight.admin.services.RuntimeService              W No running mxbeans found
    [11/25/14 15:51:47:024 GMT] 00000032 SystemErr                                                    R Exception in thread "Thread-23" 
    [11/25/14 15:51:47:024 GMT] 00000032 SystemErr                                                    R java.lang.RuntimeException: Timeout while waiting for the management service to start up
    [11/25/14 15:51:47:024 GMT] 00000032 SystemErr                                                    R     at com.worklight.core.init.WorklightServletInitializer$1.run(WorklightServletInitializer.java:133)
    [11/25/14 15:51:47:024 GMT] 00000032 SystemErr                                                    R     at java.lang.Thread.run(Thread.java:745)
    [11/25/14 15:51:47:227 GMT] 00000034 SystemErr                                                    R Exception in thread "Thread-25" 
    [11/25/14 15:51:47:227 GMT] 00000034 SystemErr                                                    R java.lang.RuntimeException: Timeout while waiting for the management service to start up
    [11/25/14 15:51:47:227 GMT] 00000034 SystemErr                                                    R     at com.worklight.core.init.WorklightServletInitializer$1.run(WorklightServletInitializer.java:133)
    [11/25/14 15:51:47:227 GMT] 00000034 SystemErr                                                    R     at java.lang.Thread.run(Thread.java:745)

Console.log:

[AUDIT   ] CWWKZ0001I: Application customerproject started in 26.351 seconds.
[AUDIT   ] CWWKZ0001I: Application advancedproject2 started in 26.881 seconds.
[AUDIT   ] CWWKF0011I: The server customer is ready to run a smarter planet.
[err] 31  WorklightManagementPU-db2  INFO   [Default Executor-thread-4] openjpa.Runtime - Starting OpenJPA 1.2.2
[err] 47  WorklightManagementPU-db2  INFO   [Default Executor-thread-4] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.DB2Dictionary" (DB2/NT64 SQL10010 ,IBM Data Server Driver for JDBC and SQLJ 4.13.127).
[WARNING ] Impossible to decode the password
[ERROR   ] Failed to obtain JMX connection to access an MBean.
There might be a JMX configuration error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[WARNING ] No running mxbeans found
[err] Exception in thread "Thread-23" 
[err] java.lang.RuntimeException: Timeout while waiting for the management service to start up
[err]   at com.worklight.core.init.WorklightServletInitializer$1.run(WorklightServletInitializer.java:133)
[err]   at java.lang.Thread.run(Thread.java:745)
[err] Exception in thread "Thread-25" 
[err] java.lang.RuntimeException: Timeout while waiting for the management service to start up
[err]   at com.worklight.core.init.WorklightServletInitializer$1.run(WorklightServletInitializer.java:133)
[err]   at java.lang.Thread.run(Thread.java:745)

admin server setup for server 'customer':

<!-- Declare the Worklight Administration Service application. -->
    <application id="customerwladmin" name="customerwladmin" 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.4.jar"/>
            </commonLibrary>
        </classloader>
    </application>

admin service setup for server 'worklight'

<!-- 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.4.jar"/>
        </commonLibrary>
    </classloader>
</application>

Solution

  • There is the following exception : sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    meaning that there is a SSL configuration issue with the certificate.