【问题标题】:Worklight project throwing error while uploading files to mobileFirstServer将文件上传到 mobileFirstServer 时 Worklight 项目抛出错误
【发布时间】:2015-08-16 08:41:59
【问题描述】:

我正在使用ant script 部署适配器和wlapp 文件覆盖mobileFirstServer。我正在使用 Java 7。使用以下代码:

<target name="deploy-wlapp">
<taskdef resource="com/worklight/ant/deployers/antlib.xml">
    <classpath>
        <pathelement location="worklight-ant-deployer.jar"/>
    </classpath>
</taskdef>
  <wladm url="http://localhost:10080/worklightadmin" user="admin"    password="admin" secure="false">
    <deploy-app runtime="myTime"    file="/Users/admin/Documents/workspace/myTime/bin/myTime-iOSnative-    1.0.wlapp"/>
</wladm>
</target>

<target name="deploy-adapter">
  <taskdef resource="com/worklight/ant/deployers/antlib.xml">
   <classpath>
  <pathelement location="worklight-ant-deployer.jar"/>
 </classpath>
</taskdef>
<wladm url="http://localhost:10080/worklightadmin" user="admin"     password="admin" secure="false">
    <deploy-adapter runtime="myTime"       file="//Users/admin/Documents/workspace/myTime/bin/Requests.adapter"/>
</wladm>
</target>

我在终端收到以下错误:

:com.ibm.worklight.admin.restclient.RESTException:访问http://localhost:10080/worklightadmin/management-apis/1.0/runtimes/myTime/adapters?locale=en_US 时出错:HTTP/1.1 404 Not Found FWLSE3002E: 找不到资源。 FWLSE3041E: 找不到 MobileFirst 项目“myTime”的 MBean。 MobileFirst 项目“myTime”的 MobileFirst 运行时 Web 应用程序可能未运行。如果它正在运行,请使用 JConsole 检查可用的 MBean。如果它没有运行,则可以在服务器的日志文件中找到完整的错误详细信息。 在 com.ibm.worklight.admin.restclient.RESTClient.getResponse(RESTClient.java:1247) 在 com.ibm.worklight.admin.restclient.RESTClient.getResponseWithTimeout(RESTClient.java:1324) 在 com.ibm.worklight.admin.restclient.RESTClient.getPOSTResponse(RESTClient.java:1442) 在 com.ibm.worklight.admin.restclient.RESTClient.getPOSTFileResponse(RESTClient.java:1464) 在 com.ibm.worklight.admin.commands.DeployAdapter.getResponse(DeployAdapter.java:41) 在 com.ibm.worklight.admin.restclient.ActionClient.execute(ActionClient.java:84) 在 com.ibm.worklight.admin.ant.types.AbstractActionElement.executeCommand(AbstractActionElement.java:76) 在 com.ibm.worklight.admin.ant.types.ActionElement.executeCommands(ActionElement.java:43) 在 com.ibm.worklight.admin.ant.WladmTask.executeCommands(WladmTask.java:705) 在 com.ibm.worklight.admin.ant.WladmTask.execute(WladmTask.java:459) 在 org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:606) 在 org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) 在 org.apache.tools.ant.Task.perform(Task.java:348) 在 org.apache.tools.ant.Target.execute(Target.java:435) 在 org.apache.tools.ant.Target.performTasks(Target.java:456) 在 org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 在 org.apache.tools.ant.Project.executeTarget(Project.java:1364) 在 org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 在 org.apache.tools.ant.Project.executeTargets(Project.java:1248) 在 org.apache.tools.ant.Main.runBuild(Main.java:851) 在 org.apache.tools.ant.Main.startAnt(Main.java:235) 在 org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) 在 org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

在 Eclipse 中显示以下错误:

错误] FWLSE3002E: 找不到资源。 FWLSE3041E: 找不到 MobileFirst 项目“myTime”的 MBean。 MobileFirst 项目“myTime”的 MobileFirst 运行时 Web 应用程序可能未运行。如果它正在运行,请使用 JConsole 检查可用的 MBean。如果它没有运行,则可以在服务器的日志文件中找到完整的错误详细信息。

相同的代码在其他项目中运行良好。

【问题讨论】:

  • 是否可以直接通过 MFP 控制台为 myTime 项目部署二进制文件,无需 ANT?
  • @Hussain Eddin 是的。我能够使用 mfp 控制台构建和部署项目。

标签: ant ibm-mobilefirst mobilefirst-adapters mobilefirst-server


【解决方案1】:

IBM Knowledgecenter 中明确提到了你不得不提到&lt;WorklightInstallDir&gt;/WorklightServer/worklight-ant-deployer.jar

所以你必须提到WorklightServer安装目录路径(worklight-ant-deployer.jar文件的绝对路径)

所以你的taskdef 应该是这样的

<taskdef resource="com/worklight/ant/deployers/antlib.xml">
    <classpath>
        <pathelement location="C:\IBM\MobileFirst_Platform_Server\WorklightServer\worklight-ant-deployer.jar"/>
    </classpath>
</taskdef>

该位置是您的 mobilefirst 服务器所在的位置。 jar 文件 单独不会做的伎俩。因此,通过提供 mobilefirst 生产服务器的绝对路径来尝试一下

【讨论】:

  • 感谢回复我只给出了绝对路径。只是为了上传目的,我做了一些编辑。相同的脚本适用于其他项目,因为我遇到了问题。
  • @kiran 正确部署适配器时发生错误。
  • 是的。部署应用和适配器时出错。
  • @kiran 我认为如果您可以尝试将项目移动到其他位置并在 eclipse 和 ant 配置中尝试相同的操作,某些服务器配置会崩溃。我的意思是新工作区导入您的项目或复制粘贴它
  • 我仍然面临同样的错误。我尝试使用正在部署的相同脚本部署其他项目,但 myTime 只面临问题。
猜你喜欢
  • 2021-12-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-05-04
相关资源
最近更新 更多