0
votes

I am using ant script to deploy adapters and wlapp file over mobileFirstServer. I am using Java 7. Using the code below:

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

I am getting the following error in terminal:

: com.ibm.worklight.admin.restclient.RESTException: Error accessing http://localhost:10080/worklightadmin/management-apis/1.0/runtimes/myTime/adapters?locale=en_US: HTTP/1.1 404 Not Found FWLSE3002E: The resource is not found. FWLSE3041E: No MBean found for MobileFirst project 'myTime'. Possibly the MobileFirst runtime web application for MobileFirst project 'myTime' is not running. If it is running, use JConsole to inspect the available MBeans. If it is not running, full error details are available in the log files of the server. at com.ibm.worklight.admin.restclient.RESTClient.getResponse(RESTClient.java:1247) at com.ibm.worklight.admin.restclient.RESTClient.getResponseWithTimeout(RESTClient.java:1324) at com.ibm.worklight.admin.restclient.RESTClient.getPOSTResponse(RESTClient.java:1442) at com.ibm.worklight.admin.restclient.RESTClient.getPOSTFileResponse(RESTClient.java:1464) at com.ibm.worklight.admin.commands.DeployAdapter.getResponse(DeployAdapter.java:41) at com.ibm.worklight.admin.restclient.ActionClient.execute(ActionClient.java:84) at com.ibm.worklight.admin.ant.types.AbstractActionElement.executeCommand(AbstractActionElement.java:76) at com.ibm.worklight.admin.ant.types.ActionElement.executeCommands(ActionElement.java:43) at com.ibm.worklight.admin.ant.WladmTask.executeCommands(WladmTask.java:705) at com.ibm.worklight.admin.ant.WladmTask.execute(WladmTask.java:459) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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)

In Eclipse the following error is shown:

ERROR ] FWLSE3002E: The resource is not found. FWLSE3041E: No MBean found for MobileFirst project 'myTime'. Possibly the MobileFirst runtime web application for MobileFirst project 'myTime' is not running. If it is running, use JConsole to inspect the available MBeans. If it is not running, full error details are available in the log files of the server.

The same code is running fine for other projects.

1
are you able to deploy the binaries for myTime project directly through MFP console, without ANT? - Sami
@Hussain Eddin Yes. I am able to build and deploy project using mfp console. - kiran

1 Answers

1
votes

It's clearly mentioned in the IBM Knowledgecenter you have to mention the <WorklightInstallDir>/WorklightServer/worklight-ant-deployer.jar

So you have to mention the WorklightServer install directory path (absolte path to the worklight-ant-deployer.jar File)

SO your taskdef should look like

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

The location is where your mobilefirst server is located. The jar file alone wont do the trick. So try it out by giving the absolute path to the mobilefirst production server