无法使用 MFP CLI v7.0 部署 MFP v6.3 适配器和应用程序

Posted

技术标签:

【中文标题】无法使用 MFP CLI v7.0 部署 MFP v6.3 适配器和应用程序【英文标题】:Cannot deploy MFP v6.3 adapters and apps with MFP CLI v7.0 【发布时间】:2015-06-18 04:55:57 【问题描述】:

背景: 我们使用 MFP v6.3 开发了一个应用程序。使用 MFP CLI v6.3,我们可以毫无问题地重新启动、构建和部署所有资产(WAR、适配器和应用程序)。

问题: 使用 MFP CLI v7.0 部署 MFP v6.3 适配器和应用程序不起作用。下面,我包括大部分来自执行'mfp restart';请注意,退出代码是 1。我还包括了“mfp bd”的输出。似乎唯一部署的 MFP 资产是 WAR 文件;未部署 MFP 适配器和应用程序。带上 MFP 控制台也证实了这一点。

MFP CLI v7.0 重启输出:

$ mfp restart -d
[...]
BUILD SUCCESSFUL
Total time: 2 seconds
mobilefirst-cli verb ant variables -Dbasedir=/Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp
mobilefirst-cli verb ant variables -Dworklight.jars.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib
mobilefirst-cli verb ant variables -Dworklight.ant.tools.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools
mobilefirst-cli verb ant variables -Dworklight.hostname=192.168.1.126
mobilefirst-cli verb ant variables -file=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml
mobilefirst-cli verb ant task install-admin
Buildfile: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml

install-admin
[...]
BUILD SUCCESSFUL
Total time: 1 second
mobilefirst-cli verb ant variables -Dbasedir=/Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp
mobilefirst-cli verb ant variables -Dworklight.jars.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib
mobilefirst-cli verb ant variables -Dworklight.ant.tools.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools
mobilefirst-cli verb ant variables -Dworklight.hostname=192.168.1.126
mobilefirst-cli verb ant variables -file=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml
mobilefirst-cli verb ant task install-WAR
Buildfile: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml

install-WAR:
[configureapplicationserver] Logging output of task <configureApplicationServer> to file /Users/olivieri/.mobilefirst_platform_server/configuration-logs/configureApplicationServer_2015_06_17_23_46_28.log
[configureapplicationserver] ** Creating migrated war file
[configureapplicationserver] Jun 17, 2015 11:46:29 PM com.worklight.ant.migration.MigrationTask MigrationTask.execute
[configureapplicationserver] INFO: FWLST2014I: The migration process was bypassed, because the project WAR file of version 7.0.0.00.20150608-1356 is compatible with the server version 7.0.0.00.20150608-1356.
[configureapplicationserver] Jun 17, 2015 11:46:29 PM com.worklight.ant.migration.MigrationTask MigrationTask.execute
[configureapplicationserver] INFO: FWLST2015I: The project WAR file was successfully copied to the destination location '/var/folders/c9/gf_f0_sd60q1mm9kxwgvlxsr0000gn/T/wla3231324120/PerchReadyApp.war'.
[configureapplicationserver] ** Created migrated war file
[configureapplicationserver] Copying /var/folders/c9/gf_f0_sd60q1mm9kxwgvlxsr0000gn/T/wla3231324120/derby.jar to /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150608-1356/server/wlp/usr/shared/resources/PerchReadyApp/derby/derby.jar
[configureapplicationserver] Copying /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150608-1356/server/wlp/usr/servers/worklight/server.xml to /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150608-1356/server/wlp/usr/servers/worklight/server.xml.bak16
[configureapplicationserver] Modifying /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150608-1356/server/wlp/usr/servers/worklight/server.xml
[configureapplicationserver] Copying /var/folders/c9/gf_f0_sd60q1mm9kxwgvlxsr0000gn/T/wla3231324120/PerchReadyApp.war to /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150608-1356/server/wlp/usr/servers/worklight/apps/PerchReadyApp.war

BUILD SUCCESSFUL
Total time: 1 second
objc[22452]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Starting server worklight.
Server worklight started with process ID 22451.
mobilefirst-cli verb ant variables -Dbasedir=/Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp
mobilefirst-cli verb ant variables -Dworklight.jars.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib
mobilefirst-cli verb ant variables -Dworklight.ant.tools.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools
mobilefirst-cli verb ant variables -Dworklight.hostname=192.168.1.126
mobilefirst-cli verb ant variables -file=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml
mobilefirst-cli verb ant task upgrade
Buildfile: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml

upgrade:
[project-upgrader] FINE: DEBUG_PERFORM_UPGRADE
[project-upgrader] INFO: FWLST1022I: Starting to migrate the PerchReadyApp project from version 6.3.0.00.20150214-1702 to version 7.0.0.00.20150608-1356.
[project-upgrader] INFO: FWLPL0025I: The PerchReadyApp project is being saved as /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/PerchReadyApp_2015_06_17_234645.backup.zip file.
[project-upgrader] path found:6.3.0.0--->7.0.0.0
[project-upgrader] FINE: DEBUG_FOUND_PATH
[project-upgrader] INFO: FWLST1226I: Added Authorization Manager Cordova plugin to config.xml (/Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/apps/Perch/iphone/native/config.xml).
[project-upgrader] FINE: DEBUG_STAMP_VERSION
[project-upgrader] WARN: FWLST1118W: Native libraries in application 'Perch' were upgraded. It is recommended to deploy this app with a new version to the WL Server and also publish a new version in the App Store for the environment(s): iphone. Clients with older SDKs will no longer receive direct update. You may want to block/notify older versions to enforce the customers to upgrade to a newer version from the app store.
[project-upgrader] INFO: FWLPL0018I: Migrating the PerchReadyApp project from version 6.3.0.00.20150214-1702 to version 7.0.0.00.20150608-1356 has succeeded.

BUILD SUCCESSFUL
Total time: 20 seconds
mobilefirst-cli verb ant variables -Dworklight.ant.tools.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools
mobilefirst-cli verb ant variables -Dworklight.hostname=192.168.1.126
mobilefirst-cli verb ant variables -file=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml
mobilefirst-cli verb ant task build-All
Buildfile: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml

build-All:

build-WAR:
     [echo] Building worklight WAR for project PerchReadyApp
[war-builder] Ignoring contents of 'server/java' folder. To include this folder, set the 'compileJava' property to true. 
[war-builder] Building war: /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/bin/PerchReadyApp.war

build-Adapters:
     [echo] Build MobileFirst adapters for project PerchReadyApp
     [echo] Building MobileFirst Adapter /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/adapters/AuthenticationAdapter
     [echo] Worklight Ant task version 7.0.0.00.20150608-1356
[adapter-builder] Building zip: /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/bin/AuthenticationAdapter.adapter
     [echo] Building MobileFirst Adapter /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/adapters/DBSetupAdapter
     [echo] Worklight Ant task version 7.0.0.00.20150608-1356
[adapter-builder] Building zip: /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/bin/DBSetupAdapter.adapter
     [echo] Building MobileFirst Adapter /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/adapters/PerchAdapter
     [echo] Worklight Ant task version 7.0.0.00.20150608-1356
[adapter-builder] Building zip: /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/bin/PerchAdapter.adapter

build-Apps:
     [echo] Build MobileFirst apps for project PerchReadyApp
     [echo] Building Hybrid MobileFirst App /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/apps/Perch
     [echo] Worklight Ant task version 7.0.0.00.20150608-1356
[app-builder] Jun 17, 2015 11:47:08 PM com.worklight.ant.builders.ApplicationBuilderTask execute
[app-builder] SUCCESS: FWLST2001I: Successfully built environments: [common, iphone]

BUILD SUCCESSFUL
Total time: 4 seconds
mobilefirst-cli verb ant variables -Dbasedir=/Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp
mobilefirst-cli verb ant variables -Dworklight.jars.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib
mobilefirst-cli verb ant variables -Dworklight.ant.tools.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools
mobilefirst-cli verb ant variables -Dworklight.hostname=192.168.1.126
mobilefirst-cli verb ant variables -file=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml
mobilefirst-cli verb ant task runtime-status
Buildfile: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml

runtime-status:
    [wladm] <?xml version="1.0" encoding="UTF-8"?>
    [wladm] <runtime name="PerchReadyApp" numberOfAdapters="0" numberOfApplications="0" synchronizationStatus="ok" numberOfActiveDevices="0" numberOfDecommissionedDevices="0" isDeviceTabEnabled="true" isAccessManagementEnabled="false" analyticsConsolePath="http://192.168.1.126:10080/analytics/console" bitlyApiKey="" bitlyUsername="" platformVersion="7.0.0.00.20150608-1356" serverVersion="7.0.0.00.20150608-1356" developmentMode="true" deviceTrackingEnabled="true" running="true" auditEnabled="true" topology="STANDALONE" productVersion="7.0.0.00-20150608-1356">
    [wladm]   <license numberOfActiveDevices="0" numberOfInactiveDevices="0" numberOfApplications="0" numberOfServers="0" lastReportDate="2015-06-18T04:43:10.546Z" decommissionTaskInterval="86400" decommissionWhen="90" maxNumberOfRecordedDevices="0" maxNumberOfRecordedDevicesOnDate="2015-06-18T04:31:50.030Z" archiveDecommissionWhen="90"/>
    [wladm] </runtime>

BUILD SUCCESSFUL
Total time: 1 second
mobilefirst-cli verb ant variables -Dbasedir=/Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp
mobilefirst-cli verb ant variables -Dworklight.jars.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib
mobilefirst-cli verb ant variables -Dworklight.ant.tools.dir=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools
mobilefirst-cli verb ant variables -Dworklight.hostname=192.168.1.126
mobilefirst-cli verb ant variables -file=/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml
mobilefirst-cli verb ant task deploy-All
Buildfile: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml

deploy-All:

minimal-update-WAR:
[updateapplicationserver] Logging output of task <updateApplicationServer> to file /Users/olivieri/.mobilefirst_platform_server/configuration-logs/updateApplicationServer_2015_06_17_23_47_11.log
[updateapplicationserver] ** Creating migrated war file
[updateapplicationserver] Jun 17, 2015 11:47:11 PM com.worklight.ant.migration.MigrationTask MigrationTask.execute
[updateapplicationserver] INFO: FWLST2014I: The migration process was bypassed, because the project WAR file of version 7.0.0.00.20150608-1356 is compatible with the server version 7.0.0.00.20150608-1356.
[updateapplicationserver] Jun 17, 2015 11:47:11 PM com.worklight.ant.migration.MigrationTask MigrationTask.execute
[updateapplicationserver] INFO: FWLST2015I: The project WAR file was successfully copied to the destination location '/var/folders/c9/gf_f0_sd60q1mm9kxwgvlxsr0000gn/T/wla8891032652/PerchReadyApp.war'.
[updateapplicationserver] ** Created migrated war file
[updateapplicationserver] Copying /var/folders/c9/gf_f0_sd60q1mm9kxwgvlxsr0000gn/T/wla8891032652/PerchReadyApp.war to /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150608-1356/server/wlp/usr/servers/worklight/apps/PerchReadyApp.war

deploy-Adapters:
     [echo] Deploy MobileFirst adapters for project PerchReadyApp
     [echo] Deploying MobileFirst Adapter /Users/olivieri/git/Ready.App.4.Perch/PerchReadyApp/bin/AuthenticationAdapter.adapter to http://192.168.1.126:10080/worklightadmin
     [echo] Username admin
mobilefirst-cli verb cli finish with mobilefirst restart
mobilefirst-cli verb code 1

**MFP CLI v7.0 bd output:**
$ mfp bd -d
All apps and adapters were successfully built.
$

【问题讨论】:

【参考方案1】:

所以可能是语义上的,但是您不能使用 v7.0 CLI 来创建 6.3 项目。您在该项目中运行的第一个命令将强制自动升级到 CLI 级别。

我无法使用基本测试用例复制您的问题。

多功能一体机 v6.3

    创建并启动服务器 创建项目和适配器 构建、部署、测试适配器正常 停止服务器

多功能一体机 7.0

    创建并启动 v7.0 服务器 [项目自动升级到v7.0] 构建、部署、测试适配器正常

请私信我您的项目,或复制问题的子集,我会进一步挖掘和/或参与开发。

【讨论】:

以上是关于无法使用 MFP CLI v7.0 部署 MFP v6.3 适配器和应用程序的主要内容,如果未能解决你的问题,请参考以下文章

MFP CLI 7.1 适配器不会使用 mfp push 命令部署

如何使用 CLI 将适配器部署到本地 MFP 服务器?

IBM MFP 如何使用 mfpdev-cli 上传(部署).adapter?

native-app-builder ANT 任务不更新 worklight.plist 文件 (MFP v7.0)

MFP8 中的直接更新甚至无法部署最新的 Web 资源

MFP 7.1 版本适配器预览按钮不可见