“mfp push”在部署适配器时抛出 NullPointerException (MobileFirst Platform 7.1)
Posted
技术标签:
【中文标题】“mfp push”在部署适配器时抛出 NullPointerException (MobileFirst Platform 7.1)【英文标题】:"mfp push" throws NullPointerException while deploying adapter (MobileFirst Platform 7.1) 【发布时间】:2016-01-26 18:59:37 【问题描述】:使用 MobileFirst Platform CLI 版本 7.1.0.00.20151227-1730 在尝试推送我对适配器所做的更新时突然出现以下错误:
Preparing for push...
Verifying Server Configuration...
Runtime 'localMFP' will be used to push the project into.
[Error:
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:497: com.worklight.upgrader.UpgradeEngineException: java.lang.NullPointerException
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:142)
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:147)
at com.worklight.upgrader.ant.UpgraderTask.execute(UpgraderTask.java:100)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.NullPointerException
at java.text.MessageFormat.applyPattern(MessageFormat.java:436)
at java.text.MessageFormat.<init>(MessageFormat.java:362)
at java.text.MessageFormat.format(MessageFormat.java:840)
at com.worklight.upgrader.WLUpgradeEngine.findProjectVersion(WLUpgradeEngine.java:602)
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:133)
... 18 more
Total time: 3 seconds
]
Error: Sorry an error has occurred. Please check the stack above for details.
我已尝试清理项目,删除已部署的内容,将更改恢复为成功部署时所做的更改,重新安装 mfp cli,但问题仍然存在。
关于我可以做些什么来摆脱异常的任何提示?
谢谢!
【问题讨论】:
您的 Worklight 服务器版本是多少? 我在做本地推送,所以版本和CLI一样:7.1.0.00.20151227-1730 【参考方案1】:故障来自升级程序代码路径,好像适配器文件中缺少某些内容。
我的建议是创建一个新适配器并查看它是否已部署。然后,开始添加回代码。也许你会找到失败的部分。
【讨论】:
我做了什么:创建一个新项目,再次创建适配器,然后将adapter.xml和适配器JS文件替换为项目中失败的那个的内容,并且它可以工作.这表明问题不是来自适配器本身,而是来自项目的设置......您有什么建议?以上是关于“mfp push”在部署适配器时抛出 NullPointerException (MobileFirst Platform 7.1)的主要内容,如果未能解决你的问题,请参考以下文章
使用 mfp push 部署到 Azure VM 经常失败并出现错误 FWLSE3000E
Apache mod_wsgi 在部署 Django 项目时抛出错误“403 Forbidden”
IBM Mobilefirst CLI 7.1.0 错误与 mfp start 和 mfp push