IBM MobileFirst 服务器预览

Posted

技术标签:

【中文标题】IBM MobileFirst 服务器预览【英文标题】:IBM MobileFirst server preview 【发布时间】:2015-04-29 07:15:20 【问题描述】:

我在 MobileFirst V7 上开发了一个应用程序。它调用 HTTP 适配器并返回数据。它可以在我的 Eclipse 上预览。我将它部署到 MobileFirst 服务器(使用 WAS Liberty Profile)并在预览中运行它,当我调用适配器时,它会引发一个错误,即其登录 messages.log 是:

[4/28/15 23:34:16:681 EDT] 00000213 org.apache.wink.server.internal.RequestProcessor

在调用处理程序链的过程中出现以下错误:

在处理发送到http://127.0.0.1:9080/TestApp/authorization/v1/clients/preview 的 POST 请求时出现消息为“null”的 WebApplicationException (404 - Not Found)

这是我的server.xml

<server description="new server">
    <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>
        <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>
        <feature>ssl-1.0</feature>
        <feature>servlet-3.0</feature>
        <feature>jdbc-4.0</feature>
        <feature>jndi-1.0</feature>
    </featureManager>
    <httpEndpoint id="defaultHttpEndpoint"
                  host="*"
                  httpPort="9080"
                  httpsPort="9443" >
        <tcpOptions soReuseAddr="true"/>
    </httpEndpoint>
    <basicRegistry>
        <user name="WorklightRESTUser" password="Bc7CGrb9DCuF"/>
        <user name="admin" password="admin"/>
        <user name="demo" password="demo"/>
        <user name="appcenteradmin" password="admin"/>
        <group name="appcentergroup">
            <member name="demo"/>
            <member name="appcenteradmin"/>
        </group>
    </basicRegistry>

    <application id="appcenterconsole" name="appcenterconsole" location="appcenterconsole.war" type="war">
        <application-bnd>
            <security-role name="appcenteradmin">
                <group name="appcentergroup"/>
            </security-role>
        </application-bnd>
    </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='"/opt/IBM/MobileFirst_Platform_Server/ApplicationCenter/tools/android-sdk"'/>

    <library id="DB2Lib">
        <fileset dir="$shared.resource.dir/db2" includes="*.jar"/>
    </library>

    <dataSource jndiName="jdbc/AppCenterDS" transactional="false">
        <jdbcDriver libraryRef="DB2Lib"/>
        <properties.db2.jcc databaseName="APPCNTR" serverName="127.0.0.1" portNumber="50001" user="db2inst1" password="xorLz4sLChvLTs="/>
    </dataSource>

    <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="Bc7CGrb9DCuF"/>
    <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"/>

    <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>

    <library id="worklightadmin/DB2Lib">
        <fileset dir="$shared.resource.dir/worklightadmin/db2" includes="db2jcc4.jar,db2jcc_license_cu.jar"/>
    </library>

    <dataSource jndiName="worklightadmin/jdbc/WorklightAdminDS" transactional="false">
        <jdbcDriver libraryRef="worklightadmin/DB2Lib"/>
        <properties.db2.jcc databaseName="WLADMIN" serverName="127.0.0.1" portNumber="50001" user="db2inst1" password="xorLz4sLChvLTs=" currentSchema="WLADMSC"/>
    </dataSource>

    <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>

    <jndiEntry jndiName="worklightconsole/ibm.worklight.admin.endpoint" value='"*://*:*/worklightadmin"'/>

    <application id="TestApp" name="TestApp" location="TestApp.war" type="war">
        <classloader delegation="parentLast">
            <privateLibrary id="worklightlib_TestApp">
                <fileset dir="$shared.resource.dir/TestApp/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>

    <jndiEntry jndiName="TestApp/publicWorkLightProtocol" value='"http"'/>
    <jndiEntry jndiName="TestApp/publicWorkLightPort" value='"9080"'/>

    <library id="TestApp/DB2Lib">
        <fileset dir="$shared.resource.dir/TestApp/db2" includes="*.jar"/>
    </library>

    <dataSource jndiName="TestApp/jdbc/WorklightDS" transactional="false">
        <jdbcDriver libraryRef="TestApp/DB2Lib"/>
        <properties.db2.jcc databaseName="WRKLGHT" serverName="127.0.0.1" portNumber="50001" user="db2inst1" password="xorLz4sLChvLTs=" currentSchema="WRKSCHM"/>
    </dataSource>

    <dataSource jndiName="TestApp/jdbc/WorklightReportsDS" transactional="false">
        <jdbcDriver libraryRef="TestApp/DB2Lib"/>
        <properties.db2.jcc databaseName="WLREPORT" serverName="127.0.0.1" portNumber="50001" user="db2inst1" password="xorLz4sLChvLTs=" currentSchema="WLRESCHM"/>
    </dataSource>

</server>

【问题讨论】:

【参考方案1】:

预览不适用于生产环境,但是在 MFPF 7.0 的 GM 版本中仍然存在预览按钮。

我认为您可能已经达到了 APAR PI37266:

MFP 操作控制台:预览公共资源按钮必须是 隐藏在生产环境中。

因此,您应该将安装更新到最新的可用 7.0 iFix,其中预览按钮不再可用。要获取最新的 iFix,您需要登录 IBM Fix Central 网站并搜索“mobilefirst platform”以获取最新的。

如果升级到最新的 iFix 后仍然看到预览按钮,请尝试强制清除浏览器的缓存。您还可以通过检查 Chrome 的 DevTools 中的网络视图 > 预览选项卡来验证这一点。它应该显示请求/响应的属性列表,其中之一是“developmentMode:true/false”)。它应该设置为false

【讨论】:

感谢您的回答。能否给我一个 MFP V7.0 发行说明的链接 www.ibm.com/support/knowledgecenter/SSNJXP/welcome.html 即使我面临这个问题。预览选项在我的控制台中被禁用。但是当我尝试点击应用程序 url 时,我遇到了同样的错误。我无法连接数据库。任何帮助如何解决这个问题

以上是关于IBM MobileFirst 服务器预览的主要内容,如果未能解决你的问题,请参考以下文章

MobileFirst 7.0 CLI - 无法启动服务器

IBM MobileFirst 适配器调用 404

在 IBM Containers 上运行 MobileFirst 服务器

IBM Mobilefirst Java 适配器会话超时

IBM Mobilefirst CLI 7.1.0 mfp 推送错误

将 IBM MobileFirst 平台服务器从 v7.1 升级到 v8.0 时出错